1.www.xxx.com.conf的server{}配置
server {
listen 80;
server_name www.xxx.com;
index index.html index.htm index.php;
root /home/wwwroot/www.xxx.com/public;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*.(js|css)?$ {
expires 12h;
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ /. {
deny all;
}
}
2.php.ini
#在php.ini行尾配置
[HOST=www.xxx.com]
open_basedir=/home/wwwroot/www.xxx.com/:/proc/:/tmp/
[PATH=/home/wwwroot/www.xxx.com/]
open_basedir=/home/wwwroot/www.xxx.com/:/proc/:/tmp/