Welcome! Log In Create A New Profile


Why 502 Bad Gateway error?

April 15, 2024 11:37AM
The Nginx configuration is as below:

upstream nodejs {
server nodejs:3000;

server {
listen 80;
server_name default_server;
error_log /var/log/nginx/error.system-default.log;
access_log /var/log/nginx/access.system-default.log;
charset utf-8;

root /usr/share/nginx/html;
index index.html index.php index.js;
location ~ \.js$ {
proxy_pass http://nodejs;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;

location / {
autoindex on;
try_files $uri $uri/ $uri.html =404;

Why I got the following error:

# curl localhost/app.js
<head><title>502 Bad Gateway</title></head>
<center><h1>502 Bad Gateway</h1></center>

Thank you.
Subject Author Posted

Why 502 Bad Gateway error?

hack3rcon April 15, 2024 11:37AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 466 on July 09, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready