nginx 分离配置文件 conf.d和default.conf
2024-09-03 15:38:14
1. 在 nginx.conf 文件中引用 conf.d 下的所有配置文件
#在http配置节的末尾添加配置引用
http {
... #gzip on; include /etc/nginx/conf.d/*.conf;
}
2. 在 conf.d 中添加 default.conf 配置文件
server {
listen ;
server_name localhost; #charset koi8-r;
#access_log /var/log/nginx/host.access.log main; location / {
root /usr/share/nginx/html;
index index.html index.htm;
} #代理配置
location /business {
proxy_pass http://business.app.com;
} #代理配置
location /user {
proxy_pass http://user.app.com;
}
}
最新文章
- liMarquee演示12种不同的无缝滚动效果
- 基调(听云)app,服务器,质量测试手段
- 第三百零五天 how can I 坚持
- C# .Net基础知识点解答
- UVa 10188 - Automated Judge Script
- DEBUG 调试
- jqGrid Demos
- java动态代理(JDK和cglib实现对比)
- web前端-----第一弹html
- c#基础(一)
- C#事件委托概念
- Struts2拦截SQL注入
- Oracle触发bug(cursor: mutex S),造成数据库服务器CPU接近100%---SQL子游标多版本问题
- 详解Java中的final关键字
- 神文章2:文本矩阵简述 V1.0 -vivo神人
- DevExpress gridcontrol Master-Detail绑定到对象类型
- Navicat MySql乱码解决
- 51nod1538:一道难题(常系数线性递推/Cayley-Hamilton定理)
- Http协议入门:
- Idea项目:Failed to create a Maven project ‘…pom.xml’ already exists in VFS 解决