# NGINX Reverse Proxy, get 502 bad gateway on login

**URL:** <https://forum.pydio.com/t/nginx-reverse-proxy-get-502-bad-gateway-on-login/4807>\
**Category:** Pydio Cells\
**Tags:** authentication, docker\
**Created:** [November 16, 2022, 8:25am UTC](https://forum.pydio.com/t/nginx-reverse-proxy-get-502-bad-gateway-on-login/4807 "2022-11-16T08:25:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![patchint](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/patchint/32/1920_2.png) [@patchint](https://forum.pydio.com/u/patchint)\
**Post date:** [November 16, 2022, 8:25am UTC](https://forum.pydio.com/t/nginx-reverse-proxy-get-502-bad-gateway-on-login/4807/1 "2022-11-16T08:25:37Z")

</div>

Hi,

I’m trying to use Pydio by using NGINX, but I have 2 servers :

One at home, running perfectly Pydio witch Docker and NGINX, zero issues  
One at OVH, running Docker and NGINX, doing a reverse proxy on the server at home

While I’m trying to login, I get a 502 bad gateway, I have Pydio and the login page, but it gives me a 502.

Here’s my config on both servers :

at home

```auto
server {
	listen 8443 http3;
	listen [::]:8443 http3;

	listen 8443 http2 ssl;
	listen [::]:8443 http2 ssl;

	server_name pydio.web.patchli.fr pydio.patchli.fr;

	access_log /var/log/nginx/web/pydio/access.log;
	error_log /var/log/nginx/web/pydio/error.log;

	ssl_certificate /etc/nginx/ssl/patchli.fr_ecc/fullchain.cer;
	ssl_certificate_key /etc/nginx/ssl/patchli.fr_ecc/patchli.fr.key;
	ssl_stapling_file /etc/nginx/ocsp_staple/patchli.fr_ecc.der;

	include includes/custom_error_pages.conf;
	include includes/common_headers.conf;
	include includes/HSTS-preload.conf;

	set $upstream pydio:8080;
    proxy_buffering off;

	location / {
		proxy_pass https://$upstream;
		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;
        if ($http_content_type = "application/grpc") {
            grpc_pass grpcs://pydio:8080;
        }
	}
    location /ws/ {
        proxy_pass https://$upstream;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }

   location /cool/ {
        proxy_pass https://$upstream;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }
}

server {
	listen 8080;
	listen [::]:8080;
	server_name pydio.web.patchli.fr;
	return 301 https://$server_name$request_uri;
}

```

at OVH

```auto
server {
	listen 8443 http3;
	listen [::]:8443 http3;

	listen 8443 http2 ssl;
	listen [::]:8443 http2 ssl;

	server_name pydio.patchli.fr;

	access_log /var/log/nginx/marisa/pydio/access.log;
	error_log /var/log/nginx/marisa/pydio/error.log;

	ssl_certificate /etc/nginx/ssl/patchli.fr_ecc/fullchain.cer;
	ssl_certificate_key /etc/nginx/ssl/patchli.fr_ecc/patchli.fr.key;
	ssl_stapling_file /etc/nginx/ocsp_staple/patchli.fr_ecc.der;

	include includes/custom_error_pages.conf;
	include includes/common_headers.conf;
	include includes/HSTS-preload.conf;

	set $upstream pydio.web.patchli.fr;

	location / {
		proxy_pass https://$upstream;
        proxy_ssl_verify on;
        proxy_ssl_verify_depth 2;
        proxy_ssl_server_name on;
        proxy_ssl_name $host;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_ssl_protocols TLSv1.3;
        proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
        proxy_ssl_session_reuse on;
		proxy_hide_header X-Powered-By;
	}

}

server {
	listen 8080;
	listen [::]:8080;
	server_name pydio.patchli.fr;
	return 301 https://$server_name$request_uri;
}

```

---

<div class="post-metadata">

**Author:** ![patchint](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/patchint/32/1920_2.png) [@patchint](https://forum.pydio.com/u/patchint)\
**Post date:** [November 16, 2022, 7:01pm UTC](https://forum.pydio.com/t/nginx-reverse-proxy-get-502-bad-gateway-on-login/4807/2 "2022-11-16T19:01:55Z")

</div>

Okay

I search a bit with the developper tab on Firefox

On /session I get a 502, I try to fix it but I don’t know how !

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/6/61f19fa52ec15fd4250db51aea351adba0e831fd.png) [@system](https://forum.pydio.com/u/system)\
**Post date:** [May 16, 2023, 10:30am UTC](https://forum.pydio.com/t/nginx-reverse-proxy-get-502-bad-gateway-on-login/4807/3 "2023-05-16T10:30:08Z")

</div>

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