Reverse proxy configuration not working.
Closed this issue · 2 comments
Hi,
I'm running your image for a long time and wanted to place it behind a reverse NGINX proxy (Linuxserver.io SWAG)
Followed instructions and configured:
environment:
- PROXYPATH=p1mon
With the following NGINX config:
location /p1mon {
return 301 $scheme://$host/p1mon/;
}
location ^~ /p1mon/ {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app 10.0.0.156;
set $upstream_port 80;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
The homepage is reachable without P1 data, all values (energy, gas, water) are zero.
Also the the P1 dongle configured using the following SOCAT config is blank.
- SOCAT_CONF="pty,link=/dev/ttyUSB1,raw,user=root,group=root,mode=660 tcp:10.0.0.47:23,retry=forever,interval=30"
P1mon works perfect when you access it on it's internal IP but fails when behind reverse proxy.
It worked once (1 month ago) and since then it never worked again.
Any ideas, or logs needed?
Apologies, I don't seem to get updates on posted issues here.
So in my environment I was using an apache server using the ProxyPassReverse option like below. Since some time i'm using it in traefik without any issues. I'm not an nginx expert so not sure what is going wrong here. Did you use the trailing / when requesting your page?
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPassReverse /p1mon http://internalserver:8081/
Im using npm nginx proxy manager in combination with authentik a custom auth provider it works great for me without any special config. I know swag is something else but if you don’t prefer swag use npm instead. You could also use npm default authentication for securing p1mon or use authentik or authelia as custom auth provider. I really like authentik its works with all my self hosted apps providing single sign on and central user management. @intelwolf thanks for this docker version i really like it. it makes updating p1mon just so easy.