首页 > 代码库 > lnmp vhost 文件

lnmp vhost 文件

server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name blog.yangguangwei.xyz;
index index.php index.html index.htm;
root /home/wwwroot/default/blog;

#error_page 404 /404.html;
include enable-php.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 / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

access_log /home/wwwlogs/access.log;
}

 

lnmp vhost 文件