Fork me on GitHub
瞬间的惊奇真是种确幸,每种确幸都是支玄妙的俳句。吊桥抬起,退回到内心幽静的花园,邂逅的还是那种熟悉的冷冷清清又轰轰烈烈的美妙质感。这真令人欢喜。

default.conf

1、
/etc/nginx/conf.d/ 下设置一个 default.conf,server_name 设置为 localhost,如果有其他非法域名 A 记录到该机器上,
则返回默认的 Nginx 页面
server {
listen 80;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

2、
server {
listen 80;
root /var/www/html;
index index.html index.htm index.php;
server_name _;
error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /var/lib/nginx/html;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}

3、
server {
listen 80;
root /var/www/html;
index index.html index.htm index.php;
server_name _;
error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /var/lib/nginx/html;
}

location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

posted @ 2018-10-01 10:24  干嘛那么贪睡  阅读(1649)  评论(0编辑  收藏  举报