Problems with Nginx Reverse Proxy Setup
Posted: Monday 31 July 2017 16:47
I'm having problems setting up Nginx to work as a reverse proxy and was hoping that someone else here could point me in the correct direction.
I am running Domoticz and Nginx on the same Raspberry Pi and have the certificates all set up (albeit I'm getting trust errors in the browser as I've used my own CA). After following the guide, I can get the redirect working so that hitting Nginx on port 80 or 443 from my LAN it redirects me correctly to port 8080 - everything, including SSO works fine. As soon as I try from the internet however it won't work and I get a message saying Err_connection_closed from Chrome.
So far I have
- Set up a dynamic DNS on the internet that points at one of my IPs. As I want to use the same address internally I have also added it to my DNS server internally (ie externally it resolves as 1.1.1.1 but internally it is 10.10.10.10). I appreciate that this may be adding complexity but think that I have ruled out it being my main issue.
- I don't want to use port 80 externally so my router is redirecting from port xxx to Nginx listening on 80 - I can see the forwarding working correctly in my router logs.
- Tried various server_name values in the Nginx sites-available file (fqdn of the dynamic host provider, real external IP, real internal hostname) & can get none of them to work - I appreciate that the permanent redirect may now be causing confusion on my devices so I have tried clearing their caches etc. With the exception of the proxy_pass address (which is set to the real internal IP of Domoticz), everything else is exactly as in the sample file
- I disabled Domoticz from running on port 443 as it was conflicting with Nginx & preventing it from starting fully
- I've tried disabling SSO & this makes no difference
Can anyone point me at where I should look next?
I am running Domoticz and Nginx on the same Raspberry Pi and have the certificates all set up (albeit I'm getting trust errors in the browser as I've used my own CA). After following the guide, I can get the redirect working so that hitting Nginx on port 80 or 443 from my LAN it redirects me correctly to port 8080 - everything, including SSO works fine. As soon as I try from the internet however it won't work and I get a message saying Err_connection_closed from Chrome.
So far I have
- Set up a dynamic DNS on the internet that points at one of my IPs. As I want to use the same address internally I have also added it to my DNS server internally (ie externally it resolves as 1.1.1.1 but internally it is 10.10.10.10). I appreciate that this may be adding complexity but think that I have ruled out it being my main issue.
- I don't want to use port 80 externally so my router is redirecting from port xxx to Nginx listening on 80 - I can see the forwarding working correctly in my router logs.
- Tried various server_name values in the Nginx sites-available file (fqdn of the dynamic host provider, real external IP, real internal hostname) & can get none of them to work - I appreciate that the permanent redirect may now be causing confusion on my devices so I have tried clearing their caches etc. With the exception of the proxy_pass address (which is set to the real internal IP of Domoticz), everything else is exactly as in the sample file
- I disabled Domoticz from running on port 443 as it was conflicting with Nginx & preventing it from starting fully
- I've tried disabling SSO & this makes no difference
Can anyone point me at where I should look next?