安装Linux Dash小记

    |     2015年10月1日   |   学习偶记   |     评论已关闭   |    4338

服务器操作系统及环境:

[sourcecode language=”plain”]
server
{
listen 80;
#listen [::]:80;
server_name <span style="color: #0000ff;">你的域名</span>;
index index.html index.htm index.php default.html default.htm default.php;
root <span style="color: #0000ff;">/data/home/linux-dash</span>;

include none.conf;
#error_page 404 /404.html;
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
try_files $uri =404;
expires max;
access_log off;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location /linux-dash {
index index.html index.php;
}
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}

access_log <span style="color: #0000ff;">/home/wwwlogs/centos.log</span> access;
}
[/sourcecode]

第七步:添加完执行:/usr/local/nginx/sbin/nginx -t测试配置文件,执行:/usr/local/nginx/sbin/nginx -s reload 载入配置文件使其生效。

噢!评论已关闭。