Bellow is what I came up with..
server {
listen 80;
server_name maindomain.com www.maindomain.com;
location ~ ^/\~([^/]+)/(.*)$ {
location ~ ^/\~wine/(.*)$ {
rewrite ^(.*)$ http://wine.maindomain.com$1 permanent;
}
location ~ ^/\~restaurant/(.*)$ {
rewrite ^(.*)$ http://restaurant.maindomain.com$1 permanent;
}
location ~ ^/\~hotel/(.*)$ {
rewrite ^(.*)$ http://hotel.maindomain.com$1 permanent;
}
location ~ ^/\~winery/(.*)$ {
rewrite ^(.*)$ http://winery.maindomain.com$1 permanent;
}
}
location / {
root /www/webs/maindomain_com/live/main;
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ { include conf.d/php-fpm; }
}
}
Could anyone tell me if this is right?
server {
listen 80;
server_name maindomain.com www.maindomain.com;
location ~ ^/\~([^/]+)/(.*)$ {
location ~ ^/\~wine/(.*)$ {
rewrite ^(.*)$ http://wine.maindomain.com$1 permanent;
}
location ~ ^/\~restaurant/(.*)$ {
rewrite ^(.*)$ http://restaurant.maindomain.com$1 permanent;
}
location ~ ^/\~hotel/(.*)$ {
rewrite ^(.*)$ http://hotel.maindomain.com$1 permanent;
}
location ~ ^/\~winery/(.*)$ {
rewrite ^(.*)$ http://winery.maindomain.com$1 permanent;
}
}
location / {
root /www/webs/maindomain_com/live/main;
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ { include conf.d/php-fpm; }
}
}
Could anyone tell me if this is right?