Welcome! Log In Create A New Profile

Advanced

How do I have multiple web applications in web root?

Posted by davidlondonuk 
How do I have multiple web applications in web root?
September 20, 2011 06:12AM
Hi,

My webroot is /var/www, ip address is 192.168.0.100-I have directories in the webroot that are for real sites so they aren't a problem-its web apps like mailing lists or bookkeeping packages etc that are puzzling me.

I have come up with the following scheme for a default vhost like this:

server {
server_name 192.168.0.100;
root /var/www/;

location / {
root /var/www/nginx-default;
#default web pages and info.php for testing nginx and php-fpm is working
...
}

location /phplist1 {
root /var/www/phplist1;
...
}
}

I know this breaks the rules of bad layout as I am using root declaration inside of locations, instead of just the one server root (/var/www)-my problem is how do I deal with php and fast cgi? How do I pass the php to fastcgi for each location? Also would it work? Is there a better way to do it?

Thanks for any help,

David
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 104
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready