mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-02-02 01:38:15 -05:00
Added resolvers auto generation in order for hostnames to work
This commit is contained in:
parent
dba4340548
commit
eb391959aa
1
rootfs/etc/nginx/conf.d/include/resolvers.conf
Normal file
1
rootfs/etc/nginx/conf.d/include/resolvers.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Intentionally blank
|
@ -51,6 +51,10 @@ http {
|
|||||||
|
|
||||||
access_log /data/logs/default.log proxy;
|
access_log /data/logs/default.log proxy;
|
||||||
|
|
||||||
|
# Dynamically generated resolvers file
|
||||||
|
include /etc/nginx/conf.d/include/resolvers.conf;
|
||||||
|
|
||||||
|
# Files generated by NPM
|
||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
include /data/nginx/proxy_host/*.conf;
|
include /data/nginx/proxy_host/*.conf;
|
||||||
include /data/nginx/redirection_host/*.conf;
|
include /data/nginx/redirection_host/*.conf;
|
||||||
@ -59,6 +63,7 @@ http {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream {
|
stream {
|
||||||
|
# Files generated by NPM
|
||||||
include /data/nginx/stream/*.conf;
|
include /data/nginx/stream/*.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
# Create required folders
|
||||||
mkdir -p /tmp/nginx/body \
|
mkdir -p /tmp/nginx/body \
|
||||||
/var/log/nginx \
|
/var/log/nginx \
|
||||||
/data/nginx \
|
/data/nginx \
|
||||||
@ -17,4 +18,8 @@ mkdir -p /tmp/nginx/body \
|
|||||||
touch /var/log/nginx/error.log && chmod 777 /var/log/nginx/error.log
|
touch /var/log/nginx/error.log && chmod 777 /var/log/nginx/error.log
|
||||||
chown root /tmp/nginx
|
chown root /tmp/nginx
|
||||||
|
|
||||||
|
# Dynamically generate resolvers file
|
||||||
|
echo resolver $(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) ";" > /etc/nginx/conf.d/include/resolvers.conf
|
||||||
|
|
||||||
|
# Run
|
||||||
exec nginx
|
exec nginx
|
||||||
|
Loading…
Reference in New Issue
Block a user