Make Virtual Host in Engine X (nginx)
by alamster in August 14th, 2008
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.
Freelance Project:
- Craigslist Clone by cocamo
- Youth Baseball Webpage redesign by gbergkamp
- Paid Search Marketing by yammerall
- Need Quality Links for Real Estate Website SEO by cf2662
- java questions by Sam66
- Menu card by plazamar2
- Logo Design by lsmith79
- Articles needed from English first language writers only by RobMan
- Nonpublic project #353168 by anon2600
- Data scraping AJAX page with PHP by dotdoms




No Comment
Random Post
Leave Your Comments Below