0

i am having issue with my nginx configurations, i don't what did i do wrong but my server is giving 502 bad gateway i am adding the configurations

   server {
    listen 80;
    root /var/www/html;
    index index.php index.html index.htm index.nginx-debian.html;
    server_name 188.166.254.137;

    location / {
            proxy_pass http://localhost:3000;
            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;
            try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }

    location ~ /\.ht {
            deny all;
    }
 }

kindly let me know where i am doing it wrong

Azee
  • 11
  • 3

1 Answers1

1

Thanks... i have resolved my issue

location / {
           # proxy_pass http://localhost:3000;
            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;
            try_files $uri $uri/ =404;
    }

commenting proxy_pass http://localhost:3000

will work,as no on going process on port 3000

Azee
  • 11
  • 3