Welcome! Log In Create A New Profile

Advanced

Rewriting url in nginx server

Posted by bala2289 
Rewriting url in nginx server
August 08, 2012 07:33AM
hi all need help in redirecting url in nginx server.

The following are the location tags added for the /var/www contents. All the location tags should be combined instead of being separate tags.

location / {
if (-f $request_filename) {
break;
}
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
root /var/www/tube/;
}
if (!-f $request_filename) {
rewrite ^(.*)$ index.php?$uri&$args last;
break;
}

if (!-d $request_filename) {
rewrite ^(.*)$ index.php?$uri&$args last;
break;
}
}


location /rock {
if (-f $request_filename) {
break;
}
if (!-f $request_filename) {
rewrite ^(.*)$ /rock/index.php last;
break;
}

if (!-d $request_filename) {
rewrite ^(.*)$ /rock/index.php last;
break;
}
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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