Welcome! Log In Create A New Profile

Advanced

Multiple dynamic sites with one domain

Posted by shsn 
Multiple dynamic sites with one domain
November 27, 2012 07:50PM
Hi,

I'm having trouble setting up multiple sites in subdirectories (WordPress, ownCloud, bbPress etc) with a single domain. So, WordPress installed in domain.com/blog, ownCloud in domain.com/cloud and bbPress in domain.com/forum. Up until now I had several subdomains which was quite easy but having multiple sites with single domain in a subdirectory seems difficult.

I have tried '@' tag in location block for each service but I'm not sure whether I'm using it correctly.

Is there a way to use specific location block if URL matches (without using 'IF' statements)?

Thank you.

Eric.
Re: Multiple dynamic sites with one domain
December 05, 2012 05:06AM
Try somthing like this
server {
listen 80;
server_name www.domain.com;
root /home/www/;
include fpm.conf;

location = /blog{
include fpm.conf;
alias /home/www/blog/index.php;
}
location = /cloud{
include fpm.conf;
alias /home/www/owncloud/index.php;
}

}

fpm.conf is the php-fpm settings.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 208
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