几个动态的站点只有FreeBSD上有,现在没法复制,就弄了一个恢复页面。所有的URI都定向到maintenance.php文件,要保证URI是maintenance.php的时候可以正常显示PHP文件:
server {
listen 80;
server_name *.fossilet.org;
access_log /var/log/nginx/fossilet.access.log;
rewrite ^(.*)$ http://fossilet.org$1 permanent;
}
server {
listen 80;
server_name fossilet.org;
access_log /var/log/nginx/fossilet.access.log;
root /var/www/fossilet;
location / {
if (-f $document_root/maintenance.php) {
return 503;
}
index index.php index.html index.html;
}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.php break;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/fossilet$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
}
没有评论:
发表评论