Welcome! Log In Create A New Profile

Advanced

Re: 502 Bad Gateway errors from Nginx when trying to access Tomcat

Francis Daly
April 23, 2016 03:52AM
On Fri, Apr 22, 2016 at 02:29:07AM -0400, gischethans wrote:

Hi there,

> I have JIRA and Nginx running on the same server with Nginx installed to
> serve as a reverse proxy.

For this to work, you need your users to connect to nginx, and you need
nginx to connect to jira.

> Browser displays Connection refused / connection timed out
> errors.

To aid debugging, can you make sure that one specific nginx config is
being used, run

curl -i http://nginx-server/

and paste the result here?

That should show whether this config leads to a "refused" or a "timed out"
-- they are different errors, with different causes.

> Trying to access the site through curl gives me 502 Bad gateway
> error. I have also checked the Nginx error log which shows this -

"bad gateway" is a different error, with a different cause.

> connect() failed (111: Connection refused) while connecting to upstream,
> client: <IP Address>, server: <FQDN>, request: "GET / HTTP/1.1", upstream:
> "http://<IP>:8080/", host: <FQDN>

That is good; it suggests that your user is connecting to nginx.

It appears that nginx is not connecting to jira.

You have jira/tomcat listening on 127.0.0.1:8080.

<IP> above should be exactly 127.0.0.1. That comes from...

> proxy_pass http://<IP>:8080/; #Here I have tried the real IP

<IP> there should be exactly 127.0.0.1.

Make that one change; make sure your new nginx.conf is being used,
test again, and report if anything is imperfect.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

502 Bad Gateway errors from Nginx when trying to access Tomcat

gischethans April 22, 2016 02:29AM

Re: 502 Bad Gateway errors from Nginx when trying to access Tomcat

mex April 22, 2016 02:49AM

Re: 502 Bad Gateway errors from Nginx when trying to access Tomcat

gischethans April 22, 2016 03:21AM

Re: 502 Bad Gateway errors from Nginx when trying to access Tomcat

Francis Daly April 23, 2016 03:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 310
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready