Welcome! Log In Create A New Profile

Advanced

Re: Location два параметра

Maxim Dounin
July 15, 2013 06:56AM
Hello!

On Sun, Jul 14, 2013 at 03:27:24PM -0400, isamitakata wrote:

> Приветствую всех! Есть проблемка, с nginx познакомился недавно, нужна
> помощь.
> Есть урл вида http://example.com/d/STRING
> Правило для него такое
>
> if ($args ~ "^linkd=(.+)$"){
> set $rule_0 1$rule_0;
> set $bref_1 $1;
> }
> if ($rule_0 = "1"){
> rewrite ^/d.php$ /d/$bref_1? permanent;
> }
> rewrite ^/d/(.*) /d.php?linkd=$1 last;
>
>
> Помогите пожалуйста оформить его так чтобы страница принимала еще и второй
> параметр.
> И чтобы было http://example.com/d/STRING/STRING2

Лучше всего сделать как-то так:

location /d/ {
fastcgi_pass ...;
fastcgi_param SCRIPT_FILENAME /path/to/d.php;
include fastcgi_param;
}

И разбирать всё дальше в php.

--
Maxim Dounin
http://nginx.org/en/donation.html

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

Location два параметра

isamitakata July 14, 2013 03:27PM

Re: Location два параметра

Maxim Dounin July 15, 2013 06:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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