Welcome! Log In Create A New Profile

Advanced

Want NGINX to reference WHM's DNS versus public NS records.

Posted by rmiller 
Want NGINX to reference WHM's DNS versus public NS records.
October 12, 2016 05:58PM
Hello,

When testing a website on my server, where the domain already exists publicly on another server, I just set my local workstation's hosts file to the IP of my server to be able to access it.

However, I noticed that NGINX (via Engintron) attempts to reference the publicly accessible domain and then returns with a "502 Bad Gateway". In other words, it's ignoring the DNS entries in WHM and looking up the real NS records for the location.

Here is an example from my Engintron error log (with masked IPs and domain):
2016/10/12 11:34:00 [error] 15425#15425: *152 connect() failed (110: Connection timed out) while connecting to upstream, client: xx.xx.xx.xx, server: localhost, request: "GET / HTTP/1.1", upstream: "http://xx.xx.xx.xx:8080/", host: "example.com"

How do I force it to reference what WHM's DNS is reporting?
Re: Want NGINX to reference WHM's DNS versus public NS records.
October 17, 2016 05:17PM
I was able to edit the "resolver" entry within nginx.conf and point it to my own DNS servers. This has solved my issue.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
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