Page 1 of 1

vesta - nginx 301 redirect - how to debug / troubleshoot

Posted: Tue Jul 25, 2017 11:27 am
by ilikejazz
Hi,

I'm trying to set up vesta for the first time on my new vps, it's mostly working but it seems that nginx forces a 301 redirect back to the same location which then shows the main ip address of the host. Regardless of how i navigate to this page via domain, alias, or ip it will still redirect back to itself with a 301 and show the real ip of the host . This is causing some problems when i try and add cloudflare as it then exposes my main host ip.

How can i diagnose this? I've looked in the nginx.conf and the apache config but there's nothing too specific.

Could it be something to do with the trailing slash i see added in curl? Any help would be appreciated.

sample curl below :

Code: Select all

 curl http://DOMAIN.com --resolve DOMAIN.com:80:IPADDRESSHERE -svo /dev/null
* Added DOMAIN.com:80:IPADDRESSHERE to DNS cache
* Rebuilt URL to:http://DOMAIN.com/
* Hostname DOMAIN.com was found in DNS cache
*   Trying IPADDRESSHERE...
* Connected to  DOMAIN.com (IPADDRESSHERE) port 80 (#0)
> GET / HTTP/1.1
> Host: DOMAIN.com
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Tue, 25 Jul 2017 11:05:47 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 0
< Connection: keep-alive
< Keep-Alive: timeout=60
< Location: http://IPADDRESS/
<
* Connection #0 to host DOMAIN.com left intact