Nginx Proxy Manager Won't Work (Apache proxying is fine) reddit / selfhosted ---------------------------------------------------------------------- gs-red · 2023-11-05 17:23 I have a few sites configured on Apache with reverse proxy and they are all working fine. I want to give nginx proxy manager a try but for some reason I am not able to make it work. I got th Let's Encrypt SSL setup done in NPM and it worked fine. I use Cloudflare for DNS and have added a test A record because someone suggested this would need A record even though I think CNAME should work as well. I may not be doing adding the proxy host correctly. I am doing the following: domain: [xyz.domain.com](https://xyz.domain.com) scheme: http (https also tried) forwarding ip: [192.168.0.10](https://192.168.0.10) (app is running on port 2323 on the host machine) forwarding port: 2323 SSL is enabled with force SSL in the SSL section. My question is: 1. What should be the forwarding IP \- when application is directly running on host \- when application is running inside a container I would think the forwardingip should be of the host, docker host i.e 192.x.x.x, the one running the proxy manager? Apache reverse proxy is working fine so I do not think Cloudflare could be cuasing any issues. I get a 522 when using NPM. And there are no entries in the logs. Any pointers would be appreciated. Thanks. ---------------------------------------------------------------------- thekrautboy · 2023-11-05 17:57 > What should be the forwarding IP Whichever IP the target service is reachable under, from the perspective of NPM. If NPM and the target are running on the same Docker host, use the container name of the target instead of any IP and use the internal port, not the port you might have mapped to the host. Ask /r/NginxProxyManager ---------------------------------------------------------------------- gs-red · 2023-11-05 18:05 Thanks. Will do that. It seems it could be to do with firewall. diasbling ufw makes it work which I do not want to do. Will raise it again on NPM subreddit. ---------------------------------------------------------------------- sarkyscouser · 2023-11-05 19:56 Try Caddy if you want an alternative ---------------------------------------------------------------------- gs-red · 2023-11-05 20:11 I just want something simple to try out. Apache proxy has worked pretty well for me. It is just a lot of manual conf files setup with enabling the required modules that takes bit of time. Caddy doesn't have a web UI I think? ---------------------------------------------------------------------- sarkyscouser · 2023-11-05 20:21 No but otherwise it's the simplest reverse proxy, very simple to set up ---------------------------------------------------------------------- TBT_TBT · 2023-11-06 09:38 To be able to address docker containers with their names, they need to be in the same docker network as the proxy server. My approach is to create an external proxy_network and configure every container I want proxied to (also) use that network. And as written in another post, with this approach you need to use the „internal“ ports, not the exposed ones. If access via proxy is enough, you in fact need no exposed ports at all for your applications. ---------------------------------------------------------------------- gs-red · 2023-11-06 09:53 Cheers! Yes I do not want to expose any ports and apache setup works really well. I have figured this one out. I have allowed docker ip range of the network where npm is running in ufw which lets me access my 192.168.x.x from within npm. Appreciate your input. ---------------------------------------------------------------------- arcadianarcadian · 2023-11-06 10:25 NPM works for docker containers, you have to give the docker container name as forwarding IP. But there is 2 workaround to achieve that. 1) socat (this little container forwards tcp/ssl requests to another container.) 2) stream host, you can create stream host on NPM to forward requests to your destination IP) ​ https://ibb.co/6ydWHJL https://ibb.co/Gx1yXg7 ---------------------------------------------------------------------- HearthCore · 2023-11-06 10:27 If it’s a firewall issue can you exclude traffic on the ports from your non instance?