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.

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?

share|improve this question

1 Answer 1

It might be helpful if you could post a sanitized version of your nginx config to see what you are doing?

I'm not sure how you have this set up, but a typical Drupal setup with Nginx sitting in front of Apache is to do a reverse / static proxy. What this means is that Nginx serves all static content such as JS files, images etc and passes all PHP requests on to Apache running on a different port.

share|improve this answer

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.