Welcome! Log In Create A New Profile

Advanced

Re: Rewrite rules in nginx config

July 17, 2015 11:38AM
On Fri, Jul 17, 2015 at 4:12 PM, dr.net <nginx-forum@nginx.us> wrote:
> 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;
> }
>
Before anything... you seem to want to serve PHP, but I don't see
anything in the config pointing to a php backend such as php-fpm...

> 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.
> }
>

As for this locations you could simplify to just one whats the "root"
path? you don't seem to define one, unless you didn't paste the full
config.

> 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
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewrite rules in nginx config

dr.net July 17, 2015 11:12AM

Re: Rewrite rules in nginx config

mike-pt July 17, 2015 11:38AM

Re: Rewrite rules in nginx config

dr.net July 17, 2015 12:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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