The original post: /r/nginx by /u/mbuhlayaw on 2025-02-18 12:40:51.
I posted last time about me asking help how to setup reverse proxy, and it was working.
https://www.reddit.com/r/nginx/comments/1im70lf/comment/mc0yq82/?context=3
However, since this morning, when trying to access the website I’m getting error 504 gateway time out. I have searched around about this issue. The configuration files in both /etc/nginx/sites-available, and /etc/nginx/sites-enabled were already created under name reverse-proxy.conf
The original contents of the file is as per below.
server { listen 8000; server_name f050i.corp.com;
access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;
location / {
proxy_pass http://10.0.0.1:8000;
} }
I have tried several things to change the config file as per below but still no luck.
- Added below in reverse-proxy.conf
server { location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_http_version 1.1; proxy_set_header Connection “”; proxy_pass http://10.0.0.1:8000; } }
- Created new config file as timeout in /etc/nginx/conf.d/timeout.conf Then added below in the file. proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600;
- Added below in the reverse-proxy.conf
server { listen 8000; server_name f050i.corp.com;
location / {
proxy_pass http://10.0.0.1:8000;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
send_timeout 60s;
}
}
I’d appreciate for any help to fix this issue.