Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Rewrite для livestreet CMS
Apache же REQUEST_URI со строки запроса сам создаёт.
Допишите $request_uri в proxy_pass, а потом уже mod_rewrite его на index.php
перенаправит.
Или можно попробовать index.php/$request_uri в try_files указать со ставкой
на path_info.
В общем рабочий вариант такой:
location / {
index index.php index.htm index.html;
error_page 404 = @backend;
root /var/www/site.com;
try_files $uri $uri/ /index.php?$args;
}
location @backend {
proxy_pass http://backend$request_uri;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;
proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;
proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;
}
location ~ \.php$ {
proxy_pass http://backend$request_uri;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;
proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;
proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;
}
--
WBR, Andrey Vasilishin CDIG1-UANIC, CDIG1-RIPE
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru
|