atom feed8 messages in ru.sysoev.nginxRe: Rewrite conversion
FromSent OnAttachments
Tseveendorj OchirlantuuJul 23, 2011 12:07 am 
Igor SysoevJul 23, 2011 12:17 am 
Tseveendorj OchirlantuuJul 23, 2011 12:31 am 
Tseveendorj OchirlantuuJul 23, 2011 3:54 am 
Tseveendorj OchirlantuuJul 23, 2011 7:33 am 
Edho AriefJul 23, 2011 8:04 am 
TseveendorjJul 24, 2011 6:09 pm 
Tseveendorj OchirlantuuNov 11, 2011 5:16 am 
Subject:Re: Rewrite conversion
From:Tseveendorj Ochirlantuu (tsev@gmail.com)
Date:Nov 11, 2011 5:16:41 am
List:ru.sysoev.nginx

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 11.07.23 23:05, Edho Arief wrote:

On Sat, Jul 23, 2011 at 9:33 PM, Tseveendorj Ochirlantuu <tsev@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; }

Really, I thought above rewrite handled by another. What do you think this popup does not work ?