I was facing the redirection issues ” Redirect loop when trying to login to WordPress admin” after moving a site to the Nginx server.
I tried myself from every aspect as per my knowledge and applied a few googled ways also(which I will also enlist below). But unfortunately, No way worked for me.
The ways which didn’t help me to fix the redirect loop issue in WordPress are:
Method 1: Clearing Browser Cookies and Cache
Method 2: Restoring Default .htaccess file
Method 3: Deactivating Themes and Plugins
Method 4: By removing session_token values in wp_usermeta table.
Method 5: By adding update_option calls in wp-login.php.
Method 6: By adding
in config file.
After a lot of research, I resolved this problem by defining security keys in the wp-config.php file.
For some reason, these values were empty after migrating the website to the Nginx server. Replace empty strings by automatically generated strings. You can find automatically generated unique string from here: