nginx.conf 配置
在配置文件结尾添加
include vhost/*.conf;
在vhost文件夹里面
域名就是文件名
xxx.xxxx.com.conf
server
{
listen 80;
server_namexxx.xxxx.com;
index index.html index.htm index.php;
root /home/wwwroot/xxx.xxxx.com/;
#error_page 404 /404.html;
include enable-php-pathinfo.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
access_log /dev/null;
}