Redirect Woes, Too Many Redirects

Hi sahsanu, thanks for your help! I’ve got the nginx directory available for download at https://milton.pibby.com/nginx-pibby.tar.gz

I don’t remember how I installed 1.15.2, I’ve been using that branch in apt for quite some time, though, ever since it started supporting http2.

I’m not getting the nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" warning because I commented out ssl on in all the config files.

All of my other domains are working fine except for pibby.com, my main site.

I removed it, but the redirect loop is still there.

Hi @pibby,

I’ve installed nginx mainline version 1.15.2 on Ubuntu, I’ve removed all the contents of /etc/nginx/ and I’ve copied all your conf, I’ve created the right paths to the certificates, some dh-param files, added entries on my /etc/hosts pointing your domains to 127.0.0.1 but I did change absolute nothing of your conf and I’m not able to reproduce your looping issue, it is working pretty fine from my side:

$ curl -IkL http://pibby.com
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Wed, 01 Aug 2018 21:54:24 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://pibby.com/

HTTP/2 200
server: nginx
date: Wed, 01 Aug 2018 21:54:24 GMT
content-type: text/html
content-length: 6
last-modified: Wed, 01 Aug 2018 21:54:15 GMT
etag: "5b622c07-6"
accept-ranges: bytes

$ curl -IkL http://www.pibby.com
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Wed, 01 Aug 2018 21:54:29 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://www.pibby.com/

HTTP/2 200
server: nginx
date: Wed, 01 Aug 2018 21:54:29 GMT
content-type: text/html
content-length: 6
last-modified: Wed, 01 Aug 2018 21:54:15 GMT
etag: "5b622c07-6"
accept-ranges: bytes

So I’ve no idea what is going on… could you please show the output of these commands (as root or using sudo)?.

netstat -ptan | grep -E '(:80 |:443 )'
ps -ef | grep [n]ginx

Cheers,
sahsanu

sudo netstat -ptan | grep -E '(:80 | :443)'
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      7477/nginx -g daemo
tcp        1      0 5.135.188.86:50360      172.245.57.197:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:60630      185.199.110.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:52956      172.64.134.3:80         CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:34902      185.199.110.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:60478      185.199.109.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:50119      172.64.135.3:80         CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:49700      172.245.57.197:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:47701      172.245.57.197:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:58456      185.53.178.7:80         CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:52415      104.24.124.121:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:36126      172.245.57.197:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:50941      104.24.121.121:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:49968      151.139.237.11:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:40801      185.199.111.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:52476      151.139.237.11:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:58132      185.199.111.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:50361      185.199.109.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:38465      151.139.237.11:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:49452      104.24.121.121:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:38117      185.199.108.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:52305      185.199.111.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:35042      104.24.124.121:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:35969      172.245.57.197:80       CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:36124      185.199.110.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:43148      185.199.111.153:80      CLOSE_WAIT  8056/python2.7
tcp        1      0 5.135.188.86:38058      151.139.237.11:80       CLOSE_WAIT  8056/python2.7
tcp6       0      0 :::80                   :::*                    LISTEN      7477/nginx -g daemo
tcp6       1      0 2001:41d0:8:c556::51273 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::44510 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::32910 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::42106 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::34772 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::47728 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::45889 2400:cb00:2048:1::ac:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::36622 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::54840 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::57444 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::35303 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::37061 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::53968 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::38710 2400:cb00:2048:1::ac:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::40384 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::41950 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::46410 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::58627 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
tcp6       1      0 2001:41d0:8:c556::37490 2400:cb00:2048:1::68:80 CLOSE_WAIT  8056/python2.7
sudo ps -ef | grep nginx
root      7477     1  0 Jul31 ?        00:00:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 11096  7477  0 Jul31 ?        00:00:06 nginx: worker process
www-data 11097  7477  0 Jul31 ?        00:00:01 nginx: worker process
www-data 11098  7477  0 Jul31 ?        00:00:00 nginx: worker process
www-data 11099  7477  0 Jul31 ?        00:00:01 nginx: worker process

Hi @pibby,

Those outputs look fine, I see no reasons for the loop redirection. Maybe you should stop nginx, check that all nginx processes are stopped and start it again or simply restart the whole server, as I said I run out of ideas :frowning:

Cheers,
sahsanu

I rebooted and it’s working now!! shrug

Thanks for all your help!

1 Like

Glad this is working fine after a reboot :sunglasses: I suppose nginx was not refreshing the conf properly :upside_down_face:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.