Yunohost in a LXC behind a reverse proxy : 502 bad gateway connection refused

Hey !
I have lxc conteneur with yunohost. I use a reverse proxy to access it.
Without any apparent reason when I try to access my yunohost conteneur in a browser I get a 502 bad gateway error. I can acces my others containers without this issue.

Here is a sample of the errors I get from the reverse proxy :
2019/08/26 11:33:29 [error] 176#176: *249 connect() failed (111: Connection refused while connecting to upstream, client: ***** server:, request: "GET / HTTP/1.1", upstream: "", host: ""

Here is my conf file from the nginx reverse proxy :

server { 
 listen 443 ssl; 
 location /{ 
 proxy_redirect off; 
 proxy_set_header Host $http_host:443; 
 proxy_set_header Host $host; 
 proxy_set_header X-Real-IP $remote_addr; 
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
 proxy_set_header X-Forwarded-Proto $scheme; 
 proxy_set_header X-Url-Scheme $scheme; 

 ssl_certificate /certificates/gafamfree/crt.pem;
ssl_certificate_key /certificates/gafamfree/key.pem; 
 ssl_session_timeout 5m; ssl_session_cache shared:SSL:50m; ssl_prefer_server_ciphers on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!aNULL:!eNULL:!LOW:!EXP:!RC4:!3DES:+HIGH:+MEDIUM; add_header Strict-Transport-Security "max-age=31536000;"; 

server { 
 listen 80; 
 location /{ 
 rewrite ^/(.*)$$1 permanent; 
 } }

I think yunohost refuse local connection because when I try to ssh in local i get a connection refused error wich don t appear when I ssh trhougt the www.
I get no messages errors in the yunohost logs, and no connection attemps in /var/log/nginx/access.log

Thx for your help ! :slight_smile:

Ps : The yunohost firewall stop running sometime but i don t know why. I get no error when I launch it manually with yunohost service start yunohost-firewall

Hey @Petitminion, please use the template for filing support requests. Thanks.

Yes sorry I forget to say the lxc container with yunohost is installed on my own computeur at home. I use proxmox to manage my containers.

Actually I can access the yunohost container through SSH and through lxc-attach (from proxmox) but not with the web gui (502 error).

Yunohost is up to date (3.6.4)

I tried to connect directly to my yunohost (by routing the port 80 and 443 to yunohost instead of my reverse proxy).
In Mozilla I get a unable to connect error.
In chromium I get the Welcome to nginx! page when trying to connect to but when I try to connect to the URL of my apps ( like I get ERR_CONNECTION_REFUSED

The error came from fail2ban but I don t know why for now. A service fail2ban restart did the trick

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.