Skip to content

Commit 01f6f94

Browse files
author
Bennett Goble
committed
Specify SERVER_NAME in tests
1 parent 22a0cb7 commit 01f6f94

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/etc/nginx/templates/default.conf.template

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# Default configuration returns 400 in order to deny any request with an
2+
# unrecognized host header (server_name.)
3+
{{ if (ne .Env.SERVER_NAME "_") }}
4+
server {
5+
listen {{ .Env.LISTEN_PORT }};
6+
server_name _;
7+
return 400;
8+
}
9+
{{ end }}
10+
111
server {
212
listen {{ .Env.LISTEN_PORT }};
313
server_name {{ .Env.SERVER_NAME }};

test/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function fail {
99

1010
LISTEN_PORT="8080" \
1111
PROXY_REVERSE_URL="http://localhost:8081" \
12+
SERVER_NAME="localhost" \
1213
STATIC_LOCATIONS="/static/:/test/static/" \
1314
/docker-entrypoint.sh
1415

0 commit comments

Comments
 (0)