【发布时间】:2014-03-28 02:57:45
【问题描述】:
我是 nginx 重写的新手,但我正在尝试在 nginx 上运行 socialengine。我有以下重写规则,这些规则似乎在除 domain.com/index.php 或 domain.com 之外的所有地方都有效。这些规则似乎适用于所有其他链接(不在 /install/ 路径中,我已经知道需要另一组重写规则)。
我的规则缺少什么?
server {
listen 8080;
server_name domain.com www.domain.com;
root /home/user/public_html;
index index.php;
#charset koi8-r;
#access_log logs/host.access.log main;
# BLOCKS ACCESS TO . FILES (.svn, .htaccess, ...)
location ~ /\. {
deny all;
}
location / {
try_files $uri $uri/ @seRules;
}
location @seRules {
rewrite /index\.php /index.php?rewrite=2;
rewrite ^(.*)$ /index.php?rewrite=1;
}
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass_request_body off;
client_body_in_file_only clean;
fastcgi_param REQUEST_BODY_FILE $request_body_file;
}
error_page 404 /404.html;
location = /404.html {
root /home/user/public_html;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/user/public_html;
}
}
【问题讨论】:
标签: nginx url-rewriting socialengine