Cannot log into wordpress after setting up LEMP

I set up nginx and got my wordpress blog up running today. I configured everything and thought it was fine, until I tried logging in at a later time and could not log in.

I followed the steps here http://codex.wordpress.org/ResettingYourPassword to reset a user's password via the mysql command line but still cannot log in.

The problem is that after typing in my password at the login page (www.domain.com/blog/wp-login.php), it doesn't say whether or not the user/password combination is incorrect, it just reloads the php page. So I think I might have misconfigured nginx somewhere.

That said, here are my server configurations:

    server {
        listen       80;
        server_name  www.domain.com *.domain.com;
        rewrite ^(.*) http://domain.com$1 permanent;
    }
    server {
        listen       80;
        server_name  domain.com;

        root   /var/www/htdocs;
        index  index.php index.html index.htm;

        # If filename doesn't exist, take the request and pass to wordpress
        # as a paramater
        location / {
            if (!-e $request_filename) {
               # This line is required or else permalinks will fail
               #rewrite ^/blog/(.+)$ /blog/index.php?q=$1 last;
               rewrite ^/(.+)$ /index.php?q=$1 last;
            }
        }

        # Pass all .php files onto a php-fpm/php-fcgi server.
        location ~ \.php$ {
            #try_files $uri $uri/ /index.php?q=$uri&$args;
            try_files $uri =404; # vulnerability workaround

            include /usr/local/nginx/conf/fastcgi_params;
            fastcgi_index index.php;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
        }

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

If it helps, I have my blog placed at domain.com/blog, but it's set up so that domain.com shows the latest posts.

Does anyone have a clue? Or is this not a nginx issue? I really don't want to have to reinstall wordpress if possible :(

I can PM the actual domain if anyone is willing to take a look.

Edit: I should add that I don't have a mail server set up on my OS, so "Lost your password?" option does not work.

2 Replies

Sounds like a cookie issue to me, check out http://codex.wordpress.org/Editing_wp-c … kie_Domain">http://codex.wordpress.org/Editingwp-config.php#SetCookie_Domain

I finally got it. cookies wasn't the problem but it led me to the solution. I found this link where someone has the same problem: ~~[http://wordpress.stackexchange.com/questions/21282/wordpress-backend-login-failed-with-the-correct" target="_blank">](http://wordpress.stackexchange.com/ques … he-correct">http://wordpress.stackexchange.com/questions/21282/wordpress-backend-login-failed-with-the-correct](

and one of the comments is:

> I've had an issue before where when taking a WP site from a test domain to the live one, I forgot to change the server address in the database so it kept trying to redirect me back to the test server's domain until I noticed and changed it.

So I did an mysql select on my site's url, and lo and behold it was set to my test server. I changed the values via mysql command line and I can now log in.

Thank you!!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct