lnmp vhost 文件

Posted yang1010

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 文件的主要内容,如果未能解决你的问题,请参考以下文章

无法访问lnmp的虚拟主机内的文件

Linux -LNMP-访问日志不记录静态文件

lnmp手动新建虚拟机

LNMP强制https访问

lnmp1.5 安装lnmpa后,添加站点

安装lnmp 时如何修改数据库数据存储地址及默认访问地址