docker icon indicating copy to clipboard operation
docker copied to clipboard

Reverse proxy seems not being detected

Open manoaratefy opened this issue 1 year ago • 1 comments

Hello, I'm facing an issue with installation. I've managed to install on localhost port 3000, and now I'm trying to put a nginx reverse proxy in the front of the app. However, the app seems not detecting the URL, it stills display http://localhost:3000 instead of http://mydomain.com. I tried to change NEXT_PUBLIC_WEBAPP_URLto http://mydomain.com instead of http://localhost:3000 in the .env but no changes.

Is there something wrong in my configuration?

Here's my nginx configuration:

server {
  listen 80;
  server_name mydomain.com www.mydomain.com;
  root /var/www/html;

  location /.well-known/ {
    try_files $uri $uri/ =404;
  }

  location / {
    proxy_pass http://localhost:3000;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Server $host;
  }
}

manoaratefy avatar Oct 25 '23 10:10 manoaratefy