浏览 1k
比如以下配置
server {
listen 80;
server_name test.123.com;
charset utf-8;
location = /test {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header Content-Type text/plain;
proxy_pass http://test/eng/bid/test;
}
}
==============
需求是想把 location单独在一个文件中配置,在这个server中引用, 应该如何配置server呢?
比如把location相关的配置都写在location.conf文件中,想在这个server中引用location.conf文件中的配置,如何实现呢?
按点赞数排序
按时间排序
在server {}中,加入#include xxxx.conf文件即可(支持通配符)。
include语法在此:http://nginx.org/en/docs/ngx_core_module.html#include
2
回答于2020-09-16 14:22