Re: 502 Bad Gateway nginx/1.24.0 (Ubuntu)

42 views
Skip to first unread message

Tom Obrien

unread,
Mar 4, 2025, 7:31:42 AMMar 4
to dspace-tech, dspace-tech
Our DSpace installation was functioning well when using IP until I install Nginx and configured with nginx so that it could bypass port 4000. However when trying to access interface we get: 

502 Bad Gateway


nginx/1.24.0 (Ubuntu)


  • Can some one help on how I can configure Nginx correctly so that it bypasses port 4000 without the error:

I have configured  "/etc/nginx/sites-enabled/default"  as follows:

server {
  listen 80;

  server_name    192.168.243.188;
  access_log /var/log/nginx/dspace-access.log;
  error_log /var/log/nginx/dspace-error.log;

  location /server {
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_pass http://localhost:8080/server;
  }

  location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:4000/;
  }
}


Kindly help.
Tom
Reply all
Reply to author
Forward
0 new messages