nginx proxy and wordpress multi user

WordPress multi user get a for serving blog experince to our student.

The architecture is :

Firewall -> FreeBSD Box -> Jail Box

A lot of jails (around 14) put inside FreeBSD Box to server student with different purpose. One of them is for wordpress muti user.

# jls

JID  IP Address      Hostname                      Path
14  172.88.0.14     blog.digitalfusi.com           /data2/jails/blogcom
13  172.88.0.12     db.digitalfusi.com             /data2/jails/db
12  172.88.0.13     demo.digitalfusi.com           /data2/jails/demoint
11  172.88.0.11     outside.digitalfusi.com        /data2/jails/outside
10  172.88.0.10     mail.rasyid.net           /data/jails/mailserver
9  172.88.0.9      sandbox.digitalfusi.com        /data2/jails/sandbox
8  172.88.0.7      blog.rasyid.net           /data2/jails/blog
7  172.88.0.8      demo2.digitalfusi.com          /data2/jails/demo2
6  172.88.0.6      palembang.digitalfusi.com      /data/jails/palembang
5  172.88.0.5      jambi.digitalfusi.com          /data/jails/jambi
4  172.88.0.4      lahat.digitalfusi.com          /data/jails/lahat
3  172.88.0.3      prabumulih.digitalfusi.com     /data/jails/prabumulih
2  172.88.0.2      linggau.digitalfusi.com        /data/jails/linggau
1  172.88.0.1      baturaja.digitalfusi.com       /data/jails/baturaja

To establish connection to jail box I use this rules in nginx.conf :

For serving *.blog.rasyid.net for end user.

server {
listen 80;
server_name www.blog.rasyid.net   .blog.rasyid.net;
location / {
proxy_pass http://172.88.0.7;
proxy_set_header Host $host;
}
}

I use nginx :

# pkg_info | grep nginx
nginx-devel-0.7.41  Robust and small WWW server

Great, I love nginx 🙂

in Work | 196 Words

Make Virtual Host in Engine X (nginx)

Since last time I install php-fpm in my freebsd box I still looking way to make virtualhost. I think its not easy to make vhost in nginx but I’m wrong 🙂

Just add :

server {

directive

}

will add new vhost.

Full sample from my vhost :

server {
        listen          80;
        server_name     sandbox.digitalfusi.com;

        location / {
            index index.php index.html;
            root  /usr/local/www/nginx/sandbox;
        }
            location ~ \.php$ {
           fastcgi_pass    127.0.0.1:9000;
           fastcgi_index   index.php;
          fastcgi_param     SCRIPT_FILENAME
  /usr/local/www/nginx/sandbox$fastcgi_script_name;
           include      fastcgi_params;
           }

    }

another feature that I learn too is ‘autoindex’ since my friend need to list all files and directory if no index files exists.

For more fancy index I need to recompile it with fancyindex but I’m OK with it 🙂

Full sample of nginx.conf for two vhost with autouindex on and off can be download from here.

in Unix | 144 Words

101 nginx tutorial and articles

I’m bit lazy to read manual and prefer to read it as a case. Nginx is my favourite now, by collecting related tutorial, blog posting and articles I hope I can learn nginx more.

Links I found so far :

  1. Reverse proxy in depth tutorial
  2. Step by step install Engine X (nginx) and php-fpm in FreeBSD
  3. Dreamier Dream Server with Nginx
  4. Setting Up nginx
  5. New Nginx.conf with optimizations
  6. NginxVirtualHostExample
  7. Nginx as a reverse proxy for Apache
  8. WordPress with Apache and NginX
  9. Moving to Nginx
  10. Nginx + PHP + PHP-FPM on Debian Etch 4.0
  11. WordPress + NGINX : plain permalinks without rewrite
  12. HOWTO: Install WordPress on Nginx
  13. NginX Reporting for Duty
  14. How to do your Nginx rewrites on a Multi User WordPress Integrated with BBPress
  15. Rewrite Non-SSL traffic to SSL Virtual Host with Nginx
  16. HOWTO: Configure nginx for Debian / Ubuntu
  17. Nginx Hacking Tips
  18. Tips on Configuring Nginx for Virtual Hosting
  19. Nginx and Memcached, a 400% boost!
  20. Install Nginx On Ubuntu Server 9.04

More links will be add.

Last Update : May 14 2009