Nginx settings are screwing up my Drupal form submissions, how do I fix?

Posted by bflora on Server Fault See other posts from Server Fault or by bflora
Published on 2011-01-04T03:35:52Z Indexed on 2011/01/04 3:55 UTC
Read the original article Hit count: 212

Filed under:
|
|

How do I tell Nginx to "ignore" specific URLS or pages on my web site?

I run a Drupal site where anonymous visitors get served via NGINX while logged in users get served via Apache. We do this to keep the load down and scale better.

It works great, except, since we set up nginx, a good number of Drupal forms no longer work.

For example, before installing Nginx, if you created a new article, then clicked "edit" and edited the article. You could click "save" and your changes to the article would be saved.

After setting up nginx, when you make edits and then click "save," the page simple refreshes, but now with "nginx-index.php" inserted into the URL. And your changes to the form were not actually saved to the database.

So if you go to edit an article, you'll be on domain.com/node/##/edit or something like that. When you try to save your changes to the form, you'll wind up at domain.com/nginx-index.php?q=node/##/edit. And your changes will not be saved.

There is a way around this, but only for administrative users. If you go to a form where this problem is happening, then comment or comment-out three lines in our settings.php file, the form will save properly.

Those three lines are:

// 'cache_form' => array(
// 'engine' => 'db', // ),

If they're commented, you uncomment them, them save the form. If they're uncommented, you comment them out and save the form.

Obviously, this sucks.

My friend who set up our server (and then left the country) told me that there are some Nginx settings that can tell it to "ignore" certain URLs or pages which could work here.

How do I do this and where do I do it?

© Server Fault or respective owner

Related posts about apache

Related posts about nginx