Wingysam / Christmas-Community

Christmas lists for families
GNU Affero General Public License v3.0
245 stars 41 forks source link

Unable to log in through reverse proxy #98

Closed xoxfaby closed 10 months ago

xoxfaby commented 10 months ago

When I connect directly, it works fine, but if I connect through the reverse proxy, after logging in, I still appear logged out but pressing "Log in" just reloads the page and does nothing else.

Wingysam commented 10 months ago

What reverse proxy and what's your configuration for it?

xoxfaby commented 10 months ago

NGINX

server {
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    server_name wishlist.domain.com;

    location / {
        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   https;

        proxy_pass http://ip:port;
    }
}
xoxfaby commented 10 months ago

and in my docker compose

    environment:
      TRUST_PROXY: proxy_ip
Wingysam commented 10 months ago

Try putting a / after the port in the nginx config.

xoxfaby commented 10 months ago

That fixed it, thank you

Wingysam commented 10 months ago

Glad I could help!