全球主机交流论坛
标题:
nginx 404 跳转 怎么写啊
[打印本页]
作者:
qijingheng
时间:
2009-12-17 14:25
标题:
nginx 404 跳转 怎么写啊
nginx.conf文件怎么写的啊,写在那里啊,
server
{
listen 80;
server_name
www.meiinv.com
;
server_name meiinv.com;
index index.html index.htm index.php;
root /home/meiinv;
#limit_conn crawler 20;
#location /status {
#stub_status on;
#jiepaisiwa_log off;
#}
location / {
rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;
rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last;
rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;
rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;
break;
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
log_format meiinv '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /home/logs/meiinv.log meiinv;
}
[
本帖最后由 qijingheng 于 2009-12-17 14:28 编辑
]
作者:
cpuer
时间:
2009-12-17 15:43
标题:
回复 1# 的帖子
域名绑定目录配置下面加个 error_page 404 /404.html; 就设定了404了
作者:
qijingheng
时间:
2009-12-17 16:35
404成功.谢谢老大
作者:
cpuer
时间:
2009-12-17 16:44
标题:
回复 3# 的帖子
作者:
zyypp
时间:
2009-12-17 17:58
............
欢迎光临 全球主机交流论坛 (https://91ai.net/)
Powered by Discuz! X3.4