Ok, so you want to be able to access services running on a random port on your Synology NAS over standard ports (80 and 443). To do that, you need to do the following items:
- Enable the web station from the web services icon in control panel. This gives you Apache
- Add the following lines to the end of /usr/syno/apache/conf/httpd.conf-user (you must re-do this after doing a DSM update). Replace <accessPath> with a name, and <port> with the port it is running on. For example, http://localhost:8080/party.
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so ProxyRequests Off ProxyPreserveHost On <Location /<accessPath>> ProxyPass http://localhost:<port>/<accessPath> ProxyPassReverse http://localhost:<port>/<accessPath> </Location>
- Restart apache with “/usr/syno/etc.defaults/rc.d/S97apache-user.sh restart”
Just make sure whatever service you are doing this with has a base url of <accessPath>.
UPDATE: Just updated to DSM 5.0 and a few things have changed:
- /usr/syno/apache/ has moved to /etc/httpd/
- /usr/syno/etc/rc.d/S97apache-user.sh is gone, so just use ‘httpd -k stop|start|restart’
- You may need to create the folder /var/services/web/internal for httpd to restart
I’m trying to set this up so I can access SABnzbd which is running on the NAS from outside my network. I only want to have 80 or 443 open, but SABnzbd runs on 8080.
I added the code above to my httpd.conf-user file, but when I try to load the page I get, “Sorry, the page you are looking for is not found.”
The following works for me.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
All working for me. Except there is a buggy part of this where the httpd.conf is reset on each reboot of the NAS. It has been advised that we should edit httpd.conf-sys, however I have yet to try it!
I guess I don’t restart my NAS all that often, so I haven’t noticed if it gets reset or not. I think the only times I restart now are after an update!
Comments are closed.