Moin Thomas,
schnapp dir mal ein funktionierendes Beispiel und baue es an den 2-3 Stellen um. Ich hatte vorher schon mal einige Beispiele gepostet.
Du solltest schon nur auf einen besimmten Port reagieren und den Block nur für eine bestimmte Anfrage nutzen -> server_name
Sonst leitest du ja alles um...
Hallo Lord
danke für den Tip aber irgendwie haut das bei mir gar nicht hin. Einfachste Beispiele bringen Fehler im /var/log/nginx/error.log.
Muss dazu sagen, habe keine feste ip und realisiere es über dyndns.org . Wenn ich dort sub Domain vorstelle läuft ja ins leere!!!!
Also Versuch mit Pfadangabe /nas wie in deinem Beispiel. Bei mir Datei: etc/nginx/sites-enabled/nginix-reserve-proxy.conf
server {
listen 80;
listen [::]:80;
server_name "meinKonto".dyndns.org/nas/;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_intercept_errors on;
proxy_http_version 1.1;
proxy_pass
http://localhost:5000;
}
}
Bringt Meldung beim Neustadt nginix (/usr/syno/etc/rc.sysv/nginx.sh reload) im /var/log/nginx/error.log
2016/04/03 18:29:02 [warn] 20460#20460: server name "xxxxxxxxx.dyndns.org/nas/" has suspicious symbols in /etc/nginx/sites-enabled/nginix-reserve-proxy.conf:5
Egal mit oder ohne Slash hinter nas.
Beim Versuch auf die Seite zuzugreifen mit Safari kommen folgende Meldungen:
2016/04/03 19:10:50 [error] 24519#24519: *53492 open() "/var/services/web/help.css" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /help.css HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/"
2016/04/03 19:10:50 [error] 24519#24519: *53497 open() "/var/services/web/scrollbar/flexcroll.css" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /scrollbar/flexcroll.css HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/"
2016/04/03 19:10:50 [error] 24519#24519: *53499 open() "/var/services/web/scrollbar/initFlexcroll.js" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /scrollbar/initFlexcroll.js HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/"
2016/04/03 19:10:50 [error] 24519#24519: *53501 open() "/var/services/web/scrollbar/flexcroll.js" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /scrollbar/flexcroll.js HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/"
2016/04/03 19:10:50 [error] 24519#24519: *53503 open() "/var/services/web/nas" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /nas HTTP/1.1", host: "xxxxxxxxx.dyndns.org"
2016/04/03 19:10:50 [error] 24519#24519: *53505 open() "/var/services/web/missing" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /missing HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/nas"
2016/04/03 19:10:52 [error] 24519#24519: *53511 open() "/var/services/web/nas" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /nas HTTP/1.1", host: "xxxxxxxxx.dyndns.org"
2016/04/03 19:10:52 [error] 24519#24519: *53513 open() "/var/services/web/missing" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /missing HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/nas"
2ter Versuch!!!
server {
listen 80;
listen [::]:80;
server_name xxxxxxxxxxx.dyndns.org;
location /nas {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_intercept_errors on;
proxy_http_version 1.1;
proxy_pass
http://localhost:5000;
}
}
Beim Reload kommt dann keine Meldung jedoch beim zugreifen auf diese Seite kommt im error.log.
2016/04/03 18:44:44 [error] 20549#20549: *52973 open() "/var/services/web/help.css" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /help.css HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/"
2016/04/03 18:44:44 [error] 20549#20549: *52979 open() "/var/services/web/scrollbar/flexcroll.css" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /scrollbar/flexcroll.css HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/"
2016/04/03 18:44:44 [error] 20549#20549: *52980 open() "/var/services/web/scrollbar/initFlexcroll.js" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /scrollbar/initFlexcroll.js HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/"
2016/04/03 18:44:44 [error] 20549#20549: *52982 open() "/var/services/web/scrollbar/flexcroll.js" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /scrollbar/flexcroll.js HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/"
2016/04/03 18:44:48 [error] 20549#20549: *52990 open() "/var/services/web/nas" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /nas HTTP/1.1", host: "xxxxxxxxx.dyndns.org"
2016/04/03 18:44:48 [error] 20549#20549: *52996 open() "/var/services/web/missing" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /missing HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/nas"
2016/04/03 18:53:02 [error] 22720#22720: *53138 open() "/var/services/web/nas" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /nas HTTP/1.1", host: "xxxxxxxxx.dyndns.org"
2016/04/03 18:53:02 [error] 22720#22720: *53142 open() "/var/services/web/missing" failed (2: No such file or directory), client: 93.221.xxx.xx, server: , request: "GET /missing HTTP/1.1", host: "xxxxxxxxx.dyndns.org", referrer: "https://xxxxxxxxx.dyndns.org/nas"
Gehe ja davon aus das ich keine Verzeichnis für nas auf dem Web Server brauche soll ja umgeleitet werde.
Hilfeeeeeeeee. Besten Dank.
MFG
Thomas