I'm trying to access my synology nas web ui behind a nginx reverse proxy running on my raspberry. Nginx reverse proxy is working for other stuff, like my ghost blog. I copy/pasted the settings to access my nas's 192.168.0.123:5000 via nas.my.domain, but I got a "Synology / Sorry, page not found" instead of DSM's login prompt.
Here is my nginx's settings
upstream nas {
server 192.168.0.123:5001;
# server 192.168.0.123:5000; KO
# server 192.168.0.123; KO
}
server {
listen 80;
return 302 https://$server_name$request_uri;
}
server {
server_name nas.my.domain;
listen 443 ssl http2;
# listen [::]:443 ssl http2;
access_log /var/log/nginx/nas.access.log;
error_log /var/log/nginx/nas.error.log;
ssl_certificate /etc/letsencrypt/live/nas.my.domain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nas.my.domain/privkey.pem;
include /etc/nginx/include/diffie-hellman;
client_max_body_size 2m;
location ~* \.(?:ico|css|js|gif|jpe?g|png|ttf|woff|)$ {
access_log off;
expires 30d;
add_header Pragma public;
add_header Cache-Control "public, mustrevalidate, proxy-revalidate";
proxy_pass https://nas;
}
location / {
proxy_set_header HOST $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_pass https://nas;
proxy_redirect off;
proxy_buffering off;
}
}
And inside the nas I set up Control Panel / External Access / Advanced with nas.my.domain http = 80 and https = 443.
Any ideas please to fix or troubleshoot this ?
Best regards,