Skip to content

Commit eb39195

Browse files
author
Jamie Curnow
committed
Added resolvers auto generation in order for hostnames to work
1 parent dba4340 commit eb39195

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Intentionally blank

rootfs/etc/nginx/nginx.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ http {
5151

5252
access_log /data/logs/default.log proxy;
5353

54+
# Dynamically generated resolvers file
55+
include /etc/nginx/conf.d/include/resolvers.conf;
56+
57+
# Files generated by NPM
5458
include /etc/nginx/conf.d/*.conf;
5559
include /data/nginx/proxy_host/*.conf;
5660
include /data/nginx/redirection_host/*.conf;
@@ -59,6 +63,7 @@ http {
5963
}
6064

6165
stream {
66+
# Files generated by NPM
6267
include /data/nginx/stream/*.conf;
6368
}
6469

rootfs/etc/services.d/nginx/run

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3+
# Create required folders
34
mkdir -p /tmp/nginx/body \
45
/var/log/nginx \
56
/data/nginx \
@@ -17,4 +18,8 @@ mkdir -p /tmp/nginx/body \
1718
touch /var/log/nginx/error.log && chmod 777 /var/log/nginx/error.log
1819
chown root /tmp/nginx
1920

21+
# Dynamically generate resolvers file
22+
echo resolver $(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) ";" > /etc/nginx/conf.d/include/resolvers.conf
23+
24+
# Run
2025
exec nginx

0 commit comments

Comments
 (0)