This is the first time I have ever worked with Nginx, and my first attempt at integrating it with Graylog. It’s also my first attempt at putting a Graylog server into production.
I don’t find Nginx too daunting given its Apache heritage and my past familiarity with it, and Graylog seems to be fairly straight forward, but I am having a strange issue that feels like a name resolution issue but I have unambiguously confirmed that it is not .
My goal is to front-end Graylog with Nginx so that I can implement SSL/TLS there instead of Graylog (the recommended approach, IIRC). Secondly, using NGINX I want to run it as both a Reverse Proxy and Load Balancer. Currently I only have on Graylog server but plan to bring others online at some point.
Now onto my problem. I have tried a variety of custom configs (using upstream and proxy_pass directives) tailored to my environment and I have also tried using a simple Graylog provided (proxy_pass) sample config and in each case the same thing happens. When attempting to connect to an internal host using an internal private subdomain of the public domain, the browser every time redirects to the TLD. For example, if my Nginx host is “graylog.internal.acme.com”, instead of getting directed to my Graylog server host, I get re-directed to the org’s website.
Here is the config that I am currently testing with:
server
{
listen 80 default_server;
listen [::]:80 default_server;
server_name graylog.internal.acme.com;location / { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Graylog-Server-URL http://$server_name/api; proxy_pass http://10.101.10.47:9000; }
}
Any thoughts on what might be happening?
Thanks in advance.