latonita Posted February 15, 2018 Share #1 Posted February 15, 2018 (edited) Hi i'm running DSM 6.1.4-15217 Update 5. Web station package installed. I tried to configure simplest reverse proxy configuration: redirect http://server/path to docker container at http://localhost:port, however it looks like for some stupid reason it cant be done via UI - only port redirection is available. So configuration tweaks required. I have read number of articles. One of those is here https://tech.setepontos.com/2016/07/06/synology-dsm-6-web-station-virtual-hosts-settings/ Most of them tell to work with /usr/local/etc/nginx/sites-enabled/* Ok. i created config file as below and put under that folder. Reloaded configs with nginx -s reload. (and yes, it picks up config, i had syntax error in my file and it told me that) server { listen 80; location /portainer { proxy_pass http://127.0.0.1:9000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } However, result is far from positive. My server named tank.local. When i open http://tank.local/portainer i always get redirected to http://tank.local:5000 Tried other containers like grafana or node-red. same result. Looked at server response : always getting 302 Moved permanently and redirection to http://tank.local:5000 I also inspected nginx.conf, tried to use another way - via /usr/loca/etc/nginx/conf.d/www.*.conf same result. at some point i was getting 404, but after i did synoservicecfg --restart nginx i'm always getting 302 moved permanently Any ideas? Edited February 15, 2018 by latonita Quote Link to comment Share on other sites More sharing options...
latonita Posted February 15, 2018 Author Share #2 Posted February 15, 2018 update: after reboot (just applied latest security patch) it stopped redirecting me (302). just always giving me 404 Quote Link to comment Share on other sites More sharing options...
aleksey_z Posted February 15, 2018 Share #3 Posted February 15, 2018 Also interesting. How to get the site (Prestashop) work with nginx. The site is in the directory /web: /volume1/web/mysite Now works with Apache 2.2. Quote Link to comment Share on other sites More sharing options...
shrabok Posted April 2, 2018 Share #4 Posted April 2, 2018 (edited) Hi @latonita I have a feeling the server block is clashing with the existing configuration in /etc/nginx/nginx.conf I have a server block for a port 80 listener which is the synology web service. Have a look in that config to see if there is an existing server listening on port 80. Also just for clarity, is tank.local your synology/xpenology device. And is path based routing (using /portainer) your only option? do you have an internal dns server and could create a CNAME record to point at tank.local like "portainer.local CNAME tank.local" and then create a host reverse proxy in DSM Application Portal to create a reverse proxy like "portainer.local:80 -> localhost:9000" I'd recommend against path based routing in nginx because of the number of synology location blocks being used and the chance that an upgrade could lose the configuration. And just for simplicity sake. I can provide additional assistance regardless of method, so if you have any additional questions I can try to assist some more. Edited April 2, 2018 by shrabok Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.