getfider / fider

Open platform to collect and prioritize feedback
https://fider.io
GNU Affero General Public License v3.0
3.04k stars 638 forks source link

[HELP] Help with self-hosted Nginx reverse proxy #1170

Open maxacarvalho opened 5 months ago

maxacarvalho commented 5 months ago

Hi, I'm using the self-hosted version.

Describe the bug I'm having an issue while trying to serve the service using Docker compose and Nginx as reverse proxy. I'm getting a 400 Bad Request error.

My config is pretty simple, here's the docker-compose.yml file:

services:
  app:
    restart: always
    image: getfider/fider:stable
    ports:
      - "8000:3000"
    environment:
      BASE_URL: http://localhost

      DATABASE_URL: REDACTED

      JWT_SECRET: REDACTED

      # From which account e-mails will be sent
      EMAIL_NOREPLY: REDACTED

      EMAIL_AWSSES_REGION: us-east-1
      EMAIL_AWSSES_ACCESS_KEY_ID: REDACTED
      EMAIL_AWSSES_SECRET_ACCESS_KEY: REDACTED

And here's the Nginx config:

server {
    server_name  roadmap.nicksaudelabs.com;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/roadmap.nicksaudelabs.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/roadmap.nicksaudelabs.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

    client_max_body_size 100m;

    location / {
        proxy_buffering off;
        proxy_request_buffering off;
        proxy_pass_request_headers on;
        proxy_pass http://localhost:8000;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $host;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect off;
        proxy_pass_header   Set-Cookie;
        proxy_read_timeout 10m;
        proxy_send_timeout 100m;
    }
}

server {
    if ($host = roadmap.nicksaudelabs.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    server_name  roadmap.nicksaudelabs.com;
    listen       80;
    return 404; # managed by Certbot
}

I'm not sure how to start debugging at the moment. The logs give me nothing 😢

I appreciate any help. Thanks.

mattwoberts commented 4 months ago

Hope you don't mind me removing the bug label - since we have many users hosting it this way without issue.

DId you get anywhere?

Webstijlen commented 1 month ago

I think your proxy pass needs to point to the internal port:

proxy_pass http://localhost:3000;