Skip to content

Nginx Configuration

The Nginx wiki is helpful and well done. It is the definitive reference, unless you enjoy reading the C source code. Still, I wouldn’t mind finding some more content that explains Nginx. I’m the kind of person that looks for the why behind the how; it just makes me feel more comfortable when I understand the philosophy of a project. I would be stoked to find a detailed write-up that does into some depth about nginx configuration files. Perhaps a chapter in a book, or even just a short article.

Here are some questions that I’d like to get answered about Nginx:

  • Is there a way to turn on debugging to see how nginx proceeds through the location blocks?
  • What is supposed to happen if a location block is nested in another location block?
    • Is this considered a good idea, or is an “if” directive the way to go instead? (I have noticed that I couldn’t do an “include” inside an “if”)

Here are some questions for which I’ve found answers:

  • Nginx gives you great flexibility when it comes to splitting up your configuration files. Deploying Rails Applications by Ezra and co. has some great suggestions on how to do this.
  • Parsing of the configuration file is top down; however, execution of the configuration file depends on some other rules — see the “How nginx Determines Which Path Matches”, part of the explanation of the location directive in the ngx_http_core_module.
  • I have cobbled together some working configurations so that I can run Mint and Wordpress side-by-side with a Rails application, through the use of FastCGI. The Nginx wiki has several FastCGI examples to get you going.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*