Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: NGINX redirection Problem - Please help me

$
0
0
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?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>