Rewrite rules in nginx config

dr.net nginx-forum at nginx.us
Fri Jul 17 15:12:42 UTC 2015


Hi all, 
thank's to accept me in this forum.

I'm a newbie... I have a problem with a rewrite rules that I imported from
apache

This is my code 


index home.php index.php;
location / {
rewrite ^/(.*)?$ /categories.php?cat=$1;
rewrite ^/(.*).html?$ /game.php?game=$1;
rewrite ^/(.*)/(.*).html?$ /game.php?game=$2 break;
}

    location /dists/ {
        # Do nothing. nginx will serve files as usual.
    }
    
    location /images/ {
        # Do nothing. nginx will serve files as usual.
    }
    location /admin/ {
        # Do nothing. nginx will serve files as usual.
    }
    location /css/ {
        # Do nothing. nginx will serve files as usual.
    }
    location /config/ {
        # Do nothing. nginx will serve files as usual.
    }

I'd like ti take parameters from cat and game and use them to know the path.

This is oc, but so... all others directories don't work.
Is this configuration so insensitive?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,260404,260404#msg-260404



More information about the nginx mailing list