Welcome! Log In Create A New Profile

Advanced

RE: Странности с QUERY_STRING

maxhl
April 13, 2010 11:32AM
Скрипт закодирован ионкубом. В апаче все работает. Вот хотел перейти на
php-fpm. Вообще это в продолжении темы в правилами реврайта:
__________________________________________________________________________
DirectoryIndex index.php
AddDefaultCharset UTF-8

<Files license.kist>
order deny,allow
deny from all
</Files>

RewriteEngine on
Options +FollowSymlinks
RewriteBase /


RewriteCond %{QUERY_STRING} (.*)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?permalink=$1&query_str=%1 [L,QSA]

#feed
RewriteRule ^feed/rss/$ _cache/rss_main.xml [L,QSA]

#sitemap
RewriteRule ^sitemap/$ index.php?page=sitemap [L,QSA]
RewriteRule ^sitemap/([0-9]+)/$ index.php?page=sitemap&spage=$1 [L,QSA]

#contact form
RewriteRule ^contact/$ index.php?page=contact_form [L,QSA]

__________________________________________________________________________
Пока сделал как то так:
__________________________________________________________________________
location / {
index index.php;
<------>error_page 404 = @nedrupal;
}

location ~ \.php$ { # location ~ ^.+.php$ {
try_files $uri @nedrupal;
<------>fastcgi_param SCRIPT_FILENAME /home/user/$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
<------>fastcgi_param PATH_INFO $fastcgi_script_name;
<------>fastcgi_pass unix:/tmp/php-fcgi.sock;
<------>fastcgi_pass_request_body off;
<------>client_body_in_file_only clean;
<------>fastcgi_param REQUEST_BODY_FILE $request_body_file;
<------>fastcgi_param<->CONTENT_TYPE<--><------>$content_type;
<------>fastcgi_param<->CONTENT_LENGTH<><------>$content_length;
<------>fastcgi_param DOCUMENT_ROOT<-><------>$document_root;
<------>fastcgi_param<->DOCUMENT_URI<--><------>$document_uri;
<------>fastcgi_param<->GATEWAY_INTERFACE<----->CGI/1.1;
<------>fastcgi_param QUERY_STRING <------>$args;
<------>fastcgi_param<->REMOTE_ADDR<---><------>$remote_addr;
<------>fastcgi_param<->REMOTE_PORT<---><------>$remote_port;
<------>fastcgi_param<->REQUEST_URI<---><------>$request_uri;
<------>fastcgi_param<->REQUEST_METHOD<><------>$request_method;
<------>fastcgi_param<->SERVER_ADDR<---><------>$server_addr;
<------>fastcgi_param<->SERVER_NAME<---><------>$server_name;
<------>fastcgi_param<->SERVER_PORT<---><------>$server_port;
<------>fastcgi_param<->SERVER_PROTOCOL><------>$server_protocol;
<------>fastcgi_param<->SERVER_SOFTWARE <------>nginx/$nginx_version;
<------>fastcgi_param REDIRECT_STATUS 200;
<------>fastcgi_index index.php;
}

location @nedrupal {
<------>fastcgi_param SCRIPT_FILENAME /home/user/index.php;
fastcgi_param SCRIPT_NAME /index.php;
<------>fastcgi_param PATH_INFO /index.php;
<------>fastcgi_pass unix:/tmp/php-fcgi.sock;
<------>fastcgi_pass_request_body off;
<------>client_body_in_file_only clean;
<------>fastcgi_param<->REQUEST_BODY_FILE<----->$request_body_file;
<------>fastcgi_param<->CONTENT_TYPE<--><------>$content_type;
<------>fastcgi_param<->CONTENT_LENGTH<><------>$content_length;
<------>fastcgi_param<->DOCUMENT_ROOT<-><------>$document_root;
<------>fastcgi_param<->DOCUMENT_URI<--><------>$document_uri;
<------>fastcgi_param<->GATEWAY_INTERFACE<----->CGI/1.1;
<------>fastcgi_param<->QUERY_STRING<--><------>permalink=$uri&query_str=$ar
gs;
<------>fastcgi_param<->REMOTE_ADDR<---><------>$remote_addr;
<------>fastcgi_param<->REMOTE_PORT<---><------>$remote_port;
<------>fastcgi_param<->REQUEST_URI<---><------>$request_uri;
<------>fastcgi_param<->REQUEST_METHOD<><------>$request_method;
<------>fastcgi_param<->SERVER_ADDR<---><------>$server_addr;
<------>fastcgi_param<->SERVER_NAME<---><------>$server_name;
<------>fastcgi_param<->SERVER_PORT<---><------>$server_port;
<------>fastcgi_param<->SERVER_PROTOCOL><------>$server_protocol;
<------>fastcgi_param<->SERVER_SOFTWARE <------>nginx/$nginx_version;
<------>fastcgi_param<->REDIRECT_STATUS 200;
}
__________________________________________________________________________

И неработает ...

-----Original Message-----
From: Aleksander [mailto:jjjx128@mail.ru]
Sent: Tuesday, April 13, 2010 6:24 PM
To: nginx-ru@nginx.org
Subject: Re: Странности с QUERY_STRING

> День добрый.
> Возникли отличия в QUERY_STRING по сравнением с апачем.
> Делаю так:
> fastcgi_param<->QUERY_STRING<--><------>permalink=$uri&query_str=$args;
> В апаче permalink=video-1/Kino-1/&query_str=
> В nginx permalink=/video-1/Kino-1/&query_str=
> Тоесть на слеш больше.
> Как это исправить?

Это в скрипте и апаче надо исправлять.
Можно попробовать вот так:
location ~ ^/(.*)$ {
fastcgi_param QUERY_STRING permalink=$1&query_str=$args;
...
}


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


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

Странности с QUERY_STRING

maxhl April 13, 2010 11:10AM

Re: Странности с QUERY_STRING

jjjx128 April 13, 2010 11:24AM

RE: Странности с QUERY_STRING

maxhl April 13, 2010 11:32AM

RE: Странности с QUERY_STRING

maxhl April 13, 2010 01:48PM

RE: Странности с QUERY_STRING

maxhl April 14, 2010 03:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 84
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready