proxy_pass

Richieste varie sui NAS Server Synology
Rispondi
Avatar utente
ste8604
Utente
Utente
Messaggi: 292
Iscritto il: lunedì 31 marzo 2014, 22:14
Contatta:

proxy_pass

Messaggio da ste8604 »

ciao,
come posso esporre sull'nginx della console del nas che gira sulla 5001 un path che punti a un applicativo interno alla lan (nello specifico sempre sul nas).
sono riuscito a farlo modificando direttamente il file di configurazione dell'nginx situato in: /etc/nginx/nginx.conf
e aggiungo questo pezzo di configurazione
location /app {
proxy_pass http://127.0.0.1:8282;
}

il problema che lo perdo ad ogni restart, come posso fare? non esiste un modo più pulito? non vorrei dover creare uno script allo startup che ricarichi la mia configurazione (anche perchè con update del firmware potrebbe rimanere obsoleto).
grazie!!
i miei lavori: http://works.stefanoroberti.com/
----------------------------------------------------------------------------------------------------------------------------------------
GTW: Vodafone station
NAS: DS216+II
HDD: 2 x ST2000DB001-1CH164
CLI: Win10 - 64bit
UPS: EATON 3S 550Din
burghy86
Moderatore
Moderatore
Messaggi: 11358
Iscritto il: martedì 11 settembre 2012, 18:59

Re: proxy_pass

Messaggio da burghy86 »

il reverse proxy non ti fa questo?
NUOVO CANALE DISCORD
PARTECIPATE NUMEROSI:

https://discord.gg/McP3d4m2pG



Passare dalla sezione presentazioni e leggere il regolamento firma obbligatorio

siamo una community, aiutateci a sentirci parte di qualcosa e non un helpdesk
Non do aiuto in privato ma sul forum a tutti!!
Un grazie ci spinge a lavorare meglio
------------------------------------------------------------
  • UPS: apc
  • GTW: fritzbox o TP-LINK TD-W8970 ISP: [ADSL] intred(20000/1024/0) IP:[pubblico]
  • SWC: hp gigabit 8 porte with poe
  • NAS: ds213, ds213j, ds415+ 720+ dmv dal 6.2 alla 7. qnap ts212p ts22, all hd con wdred/ironwolf da 2/6tb
  • CLI: win 10, win11 e ubuntu
    [altro]
  • 3 smartphone android, lettore bd with allshare samsung, vodafone tv, raspberry p2 e p3
Avatar utente
ste8604
Utente
Utente
Messaggi: 292
Iscritto il: lunedì 31 marzo 2014, 22:14
Contatta:

Re: proxy_pass

Messaggio da ste8604 »

no il reverse proxy serve per esporre una porta in https (esempio oltre alla 5001 anche la 8282), ma io vorrei sempre sulla porta 5001 l'url dell'app.
i miei lavori: http://works.stefanoroberti.com/
----------------------------------------------------------------------------------------------------------------------------------------
GTW: Vodafone station
NAS: DS216+II
HDD: 2 x ST2000DB001-1CH164
CLI: Win10 - 64bit
UPS: EATON 3S 550Din
burghy86
Moderatore
Moderatore
Messaggi: 11358
Iscritto il: martedì 11 settembre 2012, 18:59

Re: proxy_pass

Messaggio da burghy86 »

forse sbaglio ma con il proxy inverso mica puoi fare che http://app.tuoddns.diskstation.me:5001 vada ad aprire http://127.0.0.1:8282

può essere che mi sbaglio l'ho usato solo una volta ma ho letto anche questa guida:
https://stefandingemanse.nl/configure-r ... -6-beta-2/

edito. ho visto che anche qui hanno fatto lo script:
https://forum.synology.com/enu/viewtopic.php?t=127069
NUOVO CANALE DISCORD
PARTECIPATE NUMEROSI:

https://discord.gg/McP3d4m2pG



Passare dalla sezione presentazioni e leggere il regolamento firma obbligatorio

siamo una community, aiutateci a sentirci parte di qualcosa e non un helpdesk
Non do aiuto in privato ma sul forum a tutti!!
Un grazie ci spinge a lavorare meglio
------------------------------------------------------------
  • UPS: apc
  • GTW: fritzbox o TP-LINK TD-W8970 ISP: [ADSL] intred(20000/1024/0) IP:[pubblico]
  • SWC: hp gigabit 8 porte with poe
  • NAS: ds213, ds213j, ds415+ 720+ dmv dal 6.2 alla 7. qnap ts212p ts22, all hd con wdred/ironwolf da 2/6tb
  • CLI: win 10, win11 e ubuntu
    [altro]
  • 3 smartphone android, lettore bd with allshare samsung, vodafone tv, raspberry p2 e p3
Avatar utente
fullspeed
Utente
Utente
Messaggi: 1027
Iscritto il: lunedì 21 settembre 2015, 16:18
Località: Ad Sextum Lapidem

Re: proxy_pass

Messaggio da fullspeed »

trovato qui:

https://forum.synology.com/enu/viewtopic.php?t=141343

cito:

"The original post by @sinamics mentioned adding code to /etc/nginx/sites-enabled/MyCustomCode.conf but getting an error when trying to create that file. The key insight for me was the realization that the location /etc/nginx/sites-enabled is actually a symlink to /usr/local/etc/nginx/sites-enabled. If you have permission to write files there, then putting a file like MyCustomCode.conf into that expanded path should work. It did for me, anyway."

per completezza dico che nel mio NAS con DSM 5.2 la succitata directory esiste e non è un symlink, ma nella sostanza le cose non dovrebbero cambiare.

sempre relativamente a DSM6 ho trovato anche questo che cita dei files ".mustache" per effettuare modifiche permanenti.

https://forum.synology.com/enu/viewtopic.php?t=105994
"If two people always agree, one of them is useless. If they always disagree, both are useless." (Mark Twain)
  • UPS: APC Back-UPS 700VA (BX700UI)
  • ISP: Pianeta Fibra FTTH (1000M/1000M); IP: Public
  • Switch/Router PPPoE: Asus RT-AX53U (OpenWrt 22.03.5)
  • NAS: DS220+ (DSM 7.1.1-42962 Update 5); 6GB; R1(2x Toshiba N300 4TB); 2x 1Gb/s
  • NAS: DS215j (DSM 6.2.4-25556 Update 7); 512MB; R1(2x HGST DeskStar NAS 3TB); 1x 1Gb/s
  • CLI: Ubuntu Linux 22.04 LTS & 20.04 LTS; Apple Macbook Air (macOS Catalina); Microsoft Windows 10
    Altro: WETEK Hub (LibreElec 9.2.7, Kodi 18.9 Leia), Amazon Fire TV Stick, Yamaha RX-V481, Denon DRA-N4
  • EXP: E5 - NET8 PC:W4,M4,L8
Avatar utente
ste8604
Utente
Utente
Messaggi: 292
Iscritto il: lunedì 31 marzo 2014, 22:14
Contatta:

Re: proxy_pass

Messaggio da ste8604 »

fullspeed ha scritto: venerdì 4 gennaio 2019, 13:04 trovato qui:

https://forum.synology.com/enu/viewtopic.php?t=141343

cito:

"The original post by @sinamics mentioned adding code to /etc/nginx/sites-enabled/MyCustomCode.conf but getting an error when trying to create that file. The key insight for me was the realization that the location /etc/nginx/sites-enabled is actually a symlink to /usr/local/etc/nginx/sites-enabled. If you have permission to write files there, then putting a file like MyCustomCode.conf into that expanded path should work. It did for me, anyway."

per completezza dico che nel mio NAS con DSM 5.2 la succitata directory esiste e non è un symlink, ma nella sostanza le cose non dovrebbero cambiare.

sempre relativamente a DSM6 ho trovato anche questo che cita dei files ".mustache" per effettuare modifiche permanenti.

https://forum.synology.com/enu/viewtopic.php?t=105994

provato e non funziona, perchè i file presenti nella folder sites-enabled vengono aggiunti alla fine del file principale di configurazione e quindi esterni alla configurazione del server https:
"server {
listen 5001 default_server ssl http2;"

quelli inclusi sono queste folder:
include app.d/dsm.*.conf;
include /usr/syno/share/nginx/conf.d/dsm.*.conf;
include conf.d/dsm.*.conf;

quindi va messo in una di queste cartelle, il problema è che se metto un file in quelle cartelle al riavvio sparisce
i miei lavori: http://works.stefanoroberti.com/
----------------------------------------------------------------------------------------------------------------------------------------
GTW: Vodafone station
NAS: DS216+II
HDD: 2 x ST2000DB001-1CH164
CLI: Win10 - 64bit
UPS: EATON 3S 550Din
burghy86
Moderatore
Moderatore
Messaggi: 11358
Iscritto il: martedì 11 settembre 2012, 18:59

Re: proxy_pass

Messaggio da burghy86 »

NUOVO CANALE DISCORD
PARTECIPATE NUMEROSI:

https://discord.gg/McP3d4m2pG



Passare dalla sezione presentazioni e leggere il regolamento firma obbligatorio

siamo una community, aiutateci a sentirci parte di qualcosa e non un helpdesk
Non do aiuto in privato ma sul forum a tutti!!
Un grazie ci spinge a lavorare meglio
------------------------------------------------------------
  • UPS: apc
  • GTW: fritzbox o TP-LINK TD-W8970 ISP: [ADSL] intred(20000/1024/0) IP:[pubblico]
  • SWC: hp gigabit 8 porte with poe
  • NAS: ds213, ds213j, ds415+ 720+ dmv dal 6.2 alla 7. qnap ts212p ts22, all hd con wdred/ironwolf da 2/6tb
  • CLI: win 10, win11 e ubuntu
    [altro]
  • 3 smartphone android, lettore bd with allshare samsung, vodafone tv, raspberry p2 e p3
Rispondi

Torna a “DOMANDE GENERICHE”