Site redirected you too many times.

Posted January 14, 2020 2.1k views

I created a Wordpress site following up this tutorial -, haven’t configured ufw firewall, skipped that part

After installing SSL, I’m getting “ redirected you too many times” error…

Here is the server block file below

server {
        root /var/www/html;
        index index.php index.html index.htm index.nginx-debian.html;

        location / {
                #try_files $uri $uri/ =404;
        try_files $uri $uri/ /index.php$is_args$args;

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;

        location ~ /\.ht {
                deny all;
           location = /favicon.ico { log_not_found off; access_log off; }
    location = /robots.txt { log_not_found off; access_log off; allow all; }
    location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
        expires max;
        log_not_found off;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

server {
    if ($host = {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = {
        return 301 https://$host$request_uri;
    } # managed by Certbot

        listen 80;
    return 404; # managed by Certbot


How to fix that too many redirect error?

edited by bobbyiliev

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


I think that your Wordpress site and home URLs would need to be updated.

You have to change the site and the home URLs from to so that it matches the 301 redirect that you now have.

After that make sure to clear the cache of your browser and test this again.

Hope that this helps!

  • But I can’t log in to my website for this redirect error! how to change then?

    • Hi @sayansaha,

      You could either add the following two lines to your wp-config.php file:

      define( 'WP_HOME', '' );
      define( 'WP_SITEURL', '' );

      Or you could connect to your database and change the values through there, the values are in the wp_options table, you need to change the siteurl and the home values.

      Hope that this helps.