Welcome! Log In Create A New Profile

Advanced

Re: Rewrite conversion

November 11, 2011 08:26AM
Dear Igor,

You have converted apache rewrite to nginx. I appreciated very much for you.
But I need redirecting request www to non-www in my rewrite. Please
see your converted rewrite below.

Any help will be appreciated.

server {
...

root /path/to/files;

error_page 403 /index.php?do=/public/error/403/;
error_page 404 /index.php?do=/public/error/404/;

location /file/ {
}

location /install/ {
}

location /design/ {
}

location /plugins/ {
}

location = /robots.txt {
}

location = /favicon.ico {
}

location / {
fastcgi_pass ...
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/files/index.php;
fastcgi_param QUERY_STRING do=$uri;
}

location /index.php {

location = /index.php {
fastcgi_pass ...
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/files/index.php;
fastcgi_param QUERY_STRING $args;
}

location ~ ^/index.php(/.*)$ {
fastcgi_pass ...
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/files/index.php;
fastcgi_param QUERY_STRING do=$1;
}

return 404;
}


On 7/25/11, Tseveendorj <tseveendorj@gmail.com> wrote:
> On 11.07.23 23:05, Edho Arief wrote:
>> On Sat, Jul 23, 2011 at 9:33 PM, Tseveendorj Ochirlantuu
>> <tseveendorj@gmail.com> wrote:
>>> Dear Igor,
>>> I just tested rewrite but one thing did not work. When I'm
>>> accessing
>>> http://www.xac.mn/index.php?do=/mytunes/view/song_40/module_popout/ this
>>> popup but I got
>>>
>>> 404 Not Found
>>>
>>> ________________________________
>>> nginx/0.7.65
>>> on the screen. Above url is working on Apache with rewrite.
>>> I do not know difference between these two rewrites.
>>> Apache
>>> RewriteRule ^(.*)$ /index.php?do=/$1 [L]
>>> Nginx location ~ ^/index.php(/.*)$ { fastcgi_pass backend;
>>> include fastcgi_params; fastcgi_param
>>> SCRIPT_FILENAME /var/www/xac/index.php;
>>> fastcgi_param QUERY_STRING do=$1; }
>>>
>> the url
>> http://www.xac.mn/index.php?do=/mytunes/view/song_40/module_popout/
>> is handled by this location block:
>>
>> location = /index.php {
>> fastcgi_pass ...
>> include fastcgi_params;
>> fastcgi_param SCRIPT_FILENAME /path/to/files/index.php;
>> fastcgi_param QUERY_STRING $args;
>> }
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>
> Really, I thought above rewrite handled by another. What do you think
> this popup does not work ?
>
>
>
>

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

Rewrite conversion

Eberx July 23, 2011 03:08AM

Re: Rewrite conversion

Igor Sysoev July 23, 2011 03:20AM

Re: Rewrite conversion

Eberx July 23, 2011 03:32AM

Re: Rewrite conversion

Eberx July 23, 2011 06:56AM

Re: Rewrite conversion

Eberx July 23, 2011 10:36AM

Re: Rewrite conversion

Edho Arief July 23, 2011 11:08AM

Re: Rewrite conversion

Eberx July 24, 2011 09:12PM

Re: Rewrite conversion

Eberx November 11, 2011 08:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 192
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready