Questions tagged [502-error]

HTTP Error 502 Bad gateway

The HTTP Error 502 (Bad Gateway) is an HTTP status code, that means that one server received an invalid response from another server.

83 questions
128
votes
8 answers

connect() failed (111: Connection refused) while connecting to upstream

I'm experiencing 502 Gateway errors when accessing a PHP file in a directory (http://example.com/dev/index.php). The logs simply says this: 2011/09/30 23:47:54 [error] 31160#0: *35 connect() failed (111: Connection refused) while connecting to…
MacMac
  • 1,931
  • 8
  • 30
  • 38
10
votes
4 answers

What's the difference between example.com and www.example.com?

I'm a developer and I'm having trouble setting up some hosting, and I hope you guys can help me out. I've got a domain I'm setting up for a friend. URLs work fine when I use the short form, like http://example.com. That is, the pages render…
Steve Cooper
  • 205
  • 3
  • 6
7
votes
3 answers

Nginx error stating connection refused to PHP-FPM port

Newly create LEMP stack running PHP-FPM on Ubuntu 14.04 x64. Attempting to access some PHP in my webroot. Browser is showing 502 Bad Gateway and Nginx error log is showing the following (my IP and production IP removed): TIME [error] 22838#0: *7…
sparecycle
  • 459
  • 1
  • 6
  • 19
7
votes
1 answer

Resource temporarily unavailable while connecting to upstream (php5-fpm)

I frequently get this error on random pages when the are like ~+10K connections (netstat -an |grep 80 |wc -l). This happens while there is still +10GB of free memory and server load is less than 3. My relevant…
alfish
  • 3,027
  • 15
  • 45
  • 68
7
votes
2 answers

Nginx + PHP-FPM = "Random" 502 Bad Gateway

I am running Nginx and proxying php requests via FastCGI to PHP-FPM for processing. I will randomly receive 502 Bad Gateway error pages - I can reproduce this issue by clicking around my PHP websites very rapidly/refreshing a page for a minute or…
user39547
4
votes
1 answer

Difference between keepalive in apache2.conf and in ProxyPass

I am using Apache 2.2.22 What is the difference, if there is any, between the Keepalive directive in /etc/apache2/apache2.conf # # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to…
nwtnsqrd
  • 45
  • 1
  • 1
  • 5
4
votes
2 answers

How to add a fallback to my proxy in nginx?

I am trying to build a proxy for my node application through nginx thinking this will give me error pages if the node application failed or is not available on the port. The node app runs on 127.0.0.1:1337 and I am listening to mydomain:8080 and…
Dominik
  • 295
  • 2
  • 4
  • 13
4
votes
2 answers

Upgrade 2 Ghost blogs on same server, 1 quits immediately when run as a service

I have 2 Ghost blogs on a Digital Ocean server running: Ubuntu 14.04.3 LTS Nginx 1.4.6 (Ubuntu) Node v0.12.7 I used the instructions provided by Digital Ocean to set up the blogs, and they have worked fine and survived upgrades before. Last night,…
4
votes
3 answers

nginx 502 bad gateway - fastcgi not listening? (Debian 5)

I have experience with nginx but it's always been pre-installed for me (via VPS.net pre-configured image). I really like what it does for me, and now I'm trying to install it on my own server with apt-get. This is a fairly fresh Debian 5 install. I…
Sean
  • 379
  • 2
  • 3
  • 8
3
votes
1 answer

How to configure nginx.conf and php-fpm using brew servinces in MAC-OS in order to run php?

I have following logs in php-fpm log . [19-Jan-2020 15:09:33] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root [19-Jan-2020 15:09:33] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as…
3
votes
1 answer

Apache Local virtualhosts not working (502 error)

My local dev environment consists of a mac with OSX El Capitan 10.11.6. I have Apache 2.4.28 installed. Something seems to have gone wrong with my virtual host configuration as none of my local websites work when trying to access them using their…
Mr B
  • 151
  • 4
3
votes
1 answer

After upgrade from ubuntu 14.04 to 16.04, nginx error 502: bad gateway until nginx is restarted

I have researched this problem, but in most cases the cause of the 502 error is an improperly configured nginx.conf or upstream service. I believe this is different.. As the title suggests, I upgraded ubuntu server 14.04 to 16.04. I use nginx as my…
chrismeu
  • 133
  • 6
3
votes
1 answer

Nexus returns error 502 (Bad Gateway) when publishing artifacts

I've just completed the installation of Sonatype Nexus 3.2.1-01 and I'm trying to publish some artifacts using a Jenkins job and the Nexus Artifact Uploader 2.9 plugin. The upload starts fine: 100 % completed (572 kB / 572 kB). But then it throws…
Tedi
  • 161
  • 1
  • 1
  • 4
3
votes
0 answers

Docker: Nginx and hhvm socket configuration returns 502 Bad Gateway

I am trying to run nginx and hhvm with docker-compose and socket file configuration but it returns a 502 error. I can access to conf/hhvm/run/ from nginx and hhvm image. In the error.log nginx's file I got: [error] 5#5: *3 connect() to…
Avel
  • 31
  • 1
  • 4
3
votes
1 answer

(111: Connection refused) while connecting to upstream - Opsworks Rails 4

I deployed a rails 4 application in OpsWorks (Ubuntu 14.04, nginx and unicorn), when I open the homepage I'm getting a 502 Bad Gateway error. In nginx/error.log I can see this error: 2015/01/25 06:19:42 [error] 3652#0: *1 connect() to…
darkcode
  • 131
  • 1
  • 4
1
2 3 4 5 6