Rewriting url in nginx server

Discussion in 'Web Server' started by bala2289, Aug 6, 2012.

  1. bala2289

    bala2289 New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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;
    }

Share This Page