Question

Cannot log into WordPress on CentOS with nginx

I’ve just setup my web server with the following:

CentOS 6 64-bit nginx 1.5.6 php 5.5 php-fpm pagespeed APC Fail2Ban MariaDB 5.5 WP-CLI memcache

I’ve run into a weird issue. I installed the software using a custom-made bash script and it has installed without errors (after two weeks of tweaking!). I’ve created my first site on the server, but I’m not able to log into WordPress. Its like it tries to redirect or something but can’t.

My nginx configs can be seen here:

https://github.com/slushman/slushhost

The site is here:

http://christopherjoel.com/

I’m sure this is something simple like I forgot permissions or something in nginx config, but I’ve been at this for weeks and I’d like a second pair of eyes on this. Can someone take a look and help me find the issue, please?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Ok, after an exhaustive rewrite of my nginx config files, I found it. In the cache section of the main nginx.conf file, when I take out the fastcgi_hide_header line, I’m able to log in and log out and I don’t get any warnings about cookies. This thread: <br> <br>http://serverfault.com/questions/462799/leverage-proxy-caching-with-nginx-by-removing-set-cookie-header <br> <br>Makes it sounds like this is a Safari/Chrome bug. It also kinda sounds like these lines prevent cookies from being set, so I’m ok with removing it altogether.

It does not. On other sites (not hosted on Digital Ocean) I manage, I’ve had to do that very thing and it works fine. On this one, it just takes me back to the login page again. <br> <br>christopherjoel.com was a site I hosted on my current host (not DO), so I cleared my cookies thinking maybe the cookies from my previous logins on the other host were somehow preventing me from logging with the site hosted on DO. Unfortunately, now I get an error message on the login page saying: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” However, cookies are enabled in my browser. I tried to login in Firefox and Safari and get the same message in both. Cookies are enabled in all my browsers. <br> <br>I tried replacing the files, thinking maybe a file or two was incompletely copied, but that hasn’t changed anything. <br> <br>I’m going to try commenting out each part of my nginx config to see if there’s anything there preventing me from accessing the Dashboard.

<b>“Is that more clear?”</b> <br> <br>Yes! <br> <br><b>“… and hit the Submit button, the page refreshes and you’re sent to the Dashboard. In my case, I get sent back to the login with no errors.”</b> <br> <br>This is actually a not-too-uncommon WordPress problem. It’s even happened to me b/f, but can’t remember the fix @ the moment. I’ll see if I can find it; but you’re probably just as capable of Googl’ing <b>wordpress login page loop</b> (or something to that affect). <br> <br>Also, try this: <br> <br>1.) Enter your login credentials; <br>2.) When you’re redirected back to the Login Page; <br>3.) Enter <code>http://christopherjoel.com/wp-admin/</code> into your browser’s address bar & tap <code>Enter</code>. <br> <br>Does that take you into the WP Dashboard?