[ start | index | login ]

Nginx

Created by abdallah. Last edited by abdallah, 2 years and 74 days ago. Viewed 1,422 times. #1
[edit] [rdf]
labels
attachments
Nginx ("engine x") is a high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. >>http://wiki.codemongers.com/Main

Install Nginx

apt-get install nginx

Using apt-get should be enough to get nginx up and running. However, if apache is running and listening on port 80 (default) nginx will not be started.

Virtual Hosting:

Add virtual hosts in /etc/nginx/sites-available/ then create a link to /etc/nginx/sites-enabled
# ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com

server {
        listen          80;
        server_name     www.domain1.com;
        access_log      logs/domain1.access.log main;

location / { index index.html; root /var/www/domain1.com/htdocs; } }

Load Balancing:

http {
    upstream myproject {
        server 127.0.0.1:8000 weight=3;
        server 127.0.0.1:8001;
        server 127.0.0.1:8002;    
        server 127.0.0.1:8003;
    }

server { listen 80; server_name www.domain.com; location / { proxy_pass >>http://myproject; } } }

More links: >>http://wiki.codemongers.com/NginxRubyonRailsMongrel >>http://blog.labratz.net/articles/2006/10/03/rails-deployment-apache-lighttpd-nginx-mongrel-cluster

no comments | post comment
Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.