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;
}
}
default.conf的更多相关文章
- Nginx配置文件 nginx.conf 和default.conf 讲解
nginx.conf /etc/nginx/nginx.conf ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; ...
- nginx 分离配置文件 conf.d和default.conf
1. 在 nginx.conf 文件中引用 conf.d 下的所有配置文件 #在http配置节的末尾添加配置引用 http { ... #gzip on; include /etc/nginx/con ...
- Centos7安装nginx后提示“Welcome to nginx on Fedora!”,conf.d目录下无default.conf文件
问题描述 在腾讯云centos7上安装nginx sudo yum install nginx 打开默认网页显示 Welcome to nginx on Fedora! 且 /etc/nginx/co ...
- Spark Standalone spark-default.conf
Example: spark.master spark://master:7077 spark.eventLog.enabled true spark.eventLog.dir hdfs://name ...
- nginx.conf几个示例
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #erro ...
- 【转载】Docker 安装 Nginx 并个性化挂载配置文件 nginx.conf
首先,系统(3.8以上内核的linux)中安装好 Docker 这个运用程序.由于网络原因,我们下载一个Docker官方的镜像需要很长的时间,甚至下载失败.为此,阿里云容器镜像服务提供了官方的镜像站点 ...
- Dockerfile + Nginx.conf文件记录(用于前端项目部署)
Dockerfile + Nginx.conf文件记录(用于前端项目部署) 本教程依据个人理解并经过实际验证为正确,特此记录下来,权当笔记. 注:基于linux操作系统(敏感信息都进行了处理),默认服 ...
- 基础篇七:默认配置语法(/etc/nginx/nginx.conf)
首选我们 vim nginx.conf 参照上图,我们看看nginx.conf 的个参数含义 我们再看看 /etc/nginx/conf.d/default.conf
- nginx.conf指令注释
nginx.conf指令注释 ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于C ...
随机推荐
- Jeecg-Boot Spring Boot
Jeecg-Boot 1.0 发布,企业级快速开发平台 - 开源中国https://www.oschina.net/news/104889/jeecg-boot-1-0-released
- oracle小记:dba_data_files
今天给表空间扩展的时候,使用了dba_data_files进行查询.查阅了网上的资料. 该系统系统中含有以下字段 每个字段的含义如下:
- MySQL基础配置之mysql的默认字符编码的设置(my.ini设置字符编码) - 转载
MySQL基础配置之mysql的默认字符编码的设置(my.ini设置字符编码) MySQL的默认编码是Latin1,不支持中文,那么如何修改MySQL的默认编码呢,下面以设置UTF-8为例来说明. 需 ...
- [转帖]Docker的daemon.json的作用
Docker(十六)-Docker的daemon.json的作用 https://www.cnblogs.com/zhuochong/p/10070434.html jfrog 培训的时候 说过这个地 ...
- Day1 基础知识
数据类型,字符编码 二进制: 定义:二进制数据是用0和1两个数码来表示的数.它的基数为2,进位规则是“逢二进一”,借位规则是“借一当二”.当前的计算机系统使用的基本上是二进制系统,数据在计算机中主要是 ...
- python3 阿里云控制SLB权重
一.配置好RAM账号的权限(SLB管理权限) 二.安装依赖 pip3 install aliyun-python-sdk-slb pip3 install aliyun-python-sdk-core ...
- 老男孩python学习自修第十一天【内置函数】
1.基本内置函数 help() 帮助文档 dir() 列出当前文件的所有变量和方法 vars() 列出当前文件的所有变量及其值 type() 返回变量的类型 id() 返回变量的内存地址 len() ...
- Delphi窗体之间互相调用的简单问题
问题是这样的,我的程序主窗口Form1上面有一个数据连接(ADOCONNECTION1)和ADOQUERY,然后还有一些数据感知组件用于浏览用的,我打算点击From1中的一个“修改数据”按钮,就弹出F ...
- falsk sqlalchemy 自关联创建评论回复数据库
本项目在于创建类似微信上的评论回复功能的数据库 基类: from app import db from datetime import datetime class Basemadel(object) ...
- codeforces467C
George and Job CodeForces - 467C The new ITone 6 has been released recently and George got really ke ...