Configuring Nginx

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by r2b2 on December 11, 2012 at 10:56pm

Hi,

I am planning to install Nginx on a HostGator dedicated server. The problem is they (HostGator) do not support it but can install it and then its up for me to configure it. However, I have no experience configuring Nginx yet. Do you have a sample or a de-facto nginx config for Drupal 6?

Here is my setup:

Installed and configured APC
MySQL running fine
Drupal 6 running on a sub-directory (
/home/myusername/www/siteA.com/
/home/myusername/www/siteB.com/
/home/myusername/www/staging.siteA.com/
/home/myusername/www/staging.siteB.com/
)

By the way, can Nginx and Apache run alongside each other? Is it possible that siteA.com uses Apache, while siteB.com runs on Nginx? I asked because I obviously needed to test and tweak Nginx config before deploying to live.

Thank you!

Categories:

Comments

perusio's config will work

Posted by Garrett Albright on December 24, 2012 at 1:26am

perusio's config will work with Drupal 6. It's a bit confusing to get set up, especially if you're a newbie, but if you stick with it, it should work for you.

Running Apache and nginx side-by-side on the same server is possible, so long as they aren't both trying to serve via the same TCP port - that is, they can't both use ports 80 (for HTTP) and 443 (for HTTPS). Non-standard port numbers cause ugly URLs and can confuse users, so use sparingly. That being said, it really doesn't make much sense to run two web server daemons on the same machine, especially for a live/production server; it's a far better idea to just pick one and configure it for both use cases instead of trying to use two separate ones.

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /