Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
дилемма с rewrite expression
- To: nginx-ru@xxxxxxxxx
- Subject: дилемма с rewrite expression
- From: "technoplague" <nginx-forum@xxxxxxxx>
- Date: Mon, 25 Jun 2012 21:04:31 -0400 (EDT)
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tigger.jlkhosting.com; s=x; h=From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To:Date; bh=Jp9cU7A2LhqWFpT0OSAAtB/J27tuoR/ecgBpCD8ZHdY=; b=QmApYL7Tkm0gojHavzY8Vfp51Vr862MMRIlFVSH7CaLpNbAt248GvlUSEMtw841zlvLaou7ADqrd22SpGjY7N0kfIARpCh7NS41T3d+vrfN3nIe2pMD9gzvshqXKxtYb;
Привет,
В наличии имеется работающий apache
конфиг:
=========================================================
<Directory /data/www/dev/domain.com/cf/htdocs/get>
Options FollowSymlinks
RewriteEngine on
RewriteRule ^([^/\.]+)/([^/]+)$ index.php?contid=$1 [L]
</Directory>
=========================================================
Rewrite срабатывает на ура для след. урла -
domain.com/get/aa/bb, но не работает в nginx при
след. конфиге (вываливает 404):
=========================================================
upstream cf-domain {
server unix:/data/www/dev/domain.com/cf/cf-domain.sock;
}
server {
listen 62.236.108.22:80;
listen 127.0.0.1:28005;
server_name cfdev.domain.com;
access_log /data/www/dev/domain.com/cf/logs/frontend/access.log;
error_log /data/www/dev/domain.com/cf/logs/frontend/error.log;
charset utf-8;
location ~ ^/get/ {
rewrite ^([^/\.]+)/([^/]+)$ index.php?contid=$1 last;
fastcgi_pass cf-domain;
}
location / {
root /data/www/dev/domain.com/cf/htdocs;
index index.php index.html;
if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)$") {
expires max;
}
if (!-f $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
break;
}
}
location ~ (\.php)$ {
fastcgi_param SCRIPT_FILENAME
/data/www/dev/domain.com/cf/htdocs$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_pass cf-domain;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
=========================================================
Не могу разобраться где здесь проблема
- с самим выражением или с порядком
выполнения запроса?
Posted at Nginx Forum:
http://forum.nginx.org/read.php?21,227894,227894#msg-227894
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru
|