【发布时间】:2022-01-14 06:38:26
【问题描述】:
我有一个nginx 配置文件。我不想在其中输入大量带有城市列表和GeoIp 禁止访问的文本,因此我决定将其放在单独的文件中。如何从配置文件中的另一个文件中读取。
我想从另一个文件中读取并插入这里的地方(nginx.conf):
http {
access_log /var/log/nginx/access.log combined;
error_log /var/log/nginx/warn.log warn;
server_tokens off;
upstream thumbor {
server localhost:8888;
}
...
我放在一个单独的文件中并希望在配置文件的 http 块中使用:
geoip_country /usr/share/GeoIP/GeoIP.dat;
map $geoip_country_code $allowed_country {
default no;
AF no;
AG no;
...
}
【问题讨论】:
标签: nginx configuration