• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Err_too_many_redirects Only wp-admin access

DTAlfonso

New Pleskian
Hello everybody,
I have tried them all but I keep getting the same error, if I try to access wp-admin I get "ERR_TOO_MANY_REDIRECTS" error. I'll tell you.
1) Every morning the domain gave me this error "pstream timed out (110: Connection timed out) while connecting to upstream"
2) I decided to disable the option in "nginx settings Proxy mode" and magically everything is back to work (so I hoped)
3) I realized that all permalinks returned 404 error so I decided to convert the htaccess file and enter the following parameters
"if (! -f $ request_filename) {
set $ rule_1 1 $ rule_1;
}
if (! -d $ request_filename) {
set $ rule_1 2 $ rule_1;
}
if ($ rule_1 = "21") {
rewrite /. /index.php last;
} "
magically no 404 error, but from now on if I try to access the wp-admin page I get the error ERR_TOO_MANY_REDIRECTS from here on all the solutions I have entered and to try to solve this error with poor results:
1) In the wp-config file I have inserted
define ('WP_HOME', 'https: //example.com');
define ('WP_SITEURL', 'https: //example.com');
2) I have disabled "Permanent SEO-safe 301 redirect from HTTP to HTTPS"
3) I selected in Preferred domain: "example.com"
4) I deleted the wordpress cache folders
5) I have renamed the plugin folder
6) I also deleted the .htaccess file (useless now as I only use nginx)

But it still doesn't work! I'm really desperate :( Only you can help me !! What else can I try?
Thanks so much for your help.
 
ERR_TOO_MANY_REDIRECTS is clearly a mismatch between what Wordpress thinks where it is located and what the webserver thinks it should be doing.

It seems that you have created a multitude of errors, stacking on top of each other. I recommend to revert everything back to the defaults, meaning:
- Use Nginx as reverse proxy, the standard setting
- PHP: Select PHP-FPM via Apache (not Nginx)
- Hosting settings: Preferred domain must be none
- Hosting settings: Permanent 301 redirect HTTP to HTTPs: Unchecked
- Content of .htaccess file only this:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
- Make sure that in the *_options table of the Wordpress database the datasets siteurl and homepage url are in sync and are also in sync with the settings win wp-config.php and the domain in the plesk panel. This means that if you are using www in one, use it everywhere else, too. If you have https:// in the siteurl and homepage datasets, make sure that no other location uses http://, etc.
 
ERR_TOO_MANY_REDIRECTS is clearly a mismatch between what Wordpress thinks where it is located and what the webserver thinks it should be doing.

It seems that you have created a multitude of errors, stacking on top of each other. I recommend to revert everything back to the defaults, meaning:
- Use Nginx as reverse proxy, the standard setting
- PHP: Select PHP-FPM via Apache (not Nginx)
- Hosting settings: Preferred domain must be none
- Hosting settings: Permanent 301 redirect HTTP to HTTPs: Unchecked
- Content of .htaccess file only this:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
- Make sure that in the *_options table of the Wordpress database the datasets siteurl and homepage url are in sync and are also in sync with the settings win wp-config.php and the domain in the plesk panel. This means that if you are using www in one, use it everywhere else, too. If you have https:// in the siteurl and homepage datasets, make sure that no other location uses http://, etc.


Hello and thanks for your help, then I restored everything as you indicated and also checked the url in the database and they all use https // example.com now everything seems to work again, I started to change these settings because the server often returns these errors to me at certain times in nginx the error


5760#0: *19222 upstream timed out (110: Connection timed out) while connecting to upstream
peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream
5760#0: *18651 upstream timed out (110: Connection timed out) while SSL handshaking to upstream

these happens for all domains even without wordpress what depends on if it is not the proxy?
When I deactivated the server it restarted so I thought this was the error but maybe I'm wrong ...?
Thank you
 
5760#0: *19222 upstream timed out (110: Connection timed out) while connecting to upstream
peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream

these happens for all domains even without wordpress what depends on if it is not the proxy?
There can be different reasons for this error.
a) Your local IP address(es) are not whitelisted in Fail2Ban in Plesk, so that Fail2Ban is blocking Nginx from accessing Apache. --> Add your local IP addresses to the Fail2Ban whitelist.
b) The PHP-FPM service fails. This happens occasionally and can only be resolved by restarting it. To lower the number of failures, increase the pm.max_children from its default 5 to a higher number like 25 and set the pm.max_requests value to a high number like 5,000 or 10,000.
c) If it only affects a specific website, a script might not respond within the PHP timeout limit. This can happen either if there is a while...next loop in the script that never reaches an exit condition or if the script is waiting on a resource that is not delivered for some reason or if the script is trapped in an infinite rewrite loop due to some .htaccess rule or similar settings.
More reasons could apply, but not so likely as the ones mentioned above.
 
There can be different reasons for this error.
a) Your local IP address(es) are not whitelisted in Fail2Ban in Plesk, so that Fail2Ban is blocking Nginx from accessing Apache. --> Add your local IP addresses to the Fail2Ban whitelist.
b) The PHP-FPM service fails. This happens occasionally and can only be resolved by restarting it. To lower the number of failures, increase the pm.max_children from its default 5 to a higher number like 25 and set the pm.max_requests value to a high number like 5,000 or 10,000.
c) If it only affects a specific website, a script might not respond within the PHP timeout limit. This can happen either if there is a while...next loop in the script that never reaches an exit condition or if the script is waiting on a resource that is not delivered for some reason or if the script is trapped in an infinite rewrite loop due to some .htaccess rule or similar settings.
More reasons could apply, but not so likely as the ones mentioned above.
Thanks again for your help.
At the moment I checked Fail2Ban and everything is ok, I also changed the PHP-FPM parameters with the hope of not seeing the errors anymore.
For the plugins I agree with you, but the alarm bell went off just when this error from a domain without wordpress.
From today I will monitor the situation with these settings and will update you in this post.
Thank you so much for helping me.
 
Back
Top