Rewriting url in nginx server

B

bala2289

Guest
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;
}
}


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

Members online


Top