Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've set up a blog with WordPress and with Nginx acting as a proxy reverse for Apache. Everything goes really well, but there's a little problem.

When I write a new post, I can save the draft and everything works fine. But if I clic on the Publish button, the server gives a "504 Gateway time-out" error (Nginx 0.7.65 on the line below).

The strange things is that the post is indeed published if I visit my blog, there are no mistakes, everythings works right the way it should. So I just come back to my admin page and there it is, the post is listed as published, as if the 504 error was a little warning.

I think the problem has something to do with PHP (don't have PHP-FPM, just a normal install of php5 -btw, everything is under Ubuntu 10.04 LTS) or maybe with the Apache .htaccess file I've got inside the root of the blog, which is the typical .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>

Thanks in advance!

share|improve this question
    
Did you try acessing directly the backend and seeing if indeed there is a timeout when posting? –  coredump Feb 16 '11 at 12:37
    
I don't know exactly what do you mean :( I publish from the backend, and the message appears after publishing the post on the WordPress backend... –  javipas Feb 16 '11 at 22:30
add comment

3 Answers

up vote 2 down vote accepted
  • set proxy_read_timeout and proxy_send_timeout to 60
  • check nginx error log "/var/log/nginx/error.log"(commonly)
  • check Apache error log "/var/log/nginx/error.log"(commonly)
share|improve this answer
    
Adding the timeouts didn't help, the problem is still there. I've tried to check nginx and apache error logs, but haven't seen anything weird yet. I'll keep on searching for hints. Thx anyway –  javipas Feb 16 '11 at 22:31
add comment

Check if you are being redirected to a weird address such as the backends ip, localhost, 127.0.0.1 or something similar. Check your proxy_redirect sentence in nginx's config

share|improve this answer
add comment

If it only happens when you publish a post, check your list of ping servers in Settings -> Writing. Cleaning that list did the trick for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.