-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.conf.tmpl
More file actions
27 lines (22 loc) · 846 Bytes
/
default.conf.tmpl
File metadata and controls
27 lines (22 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
server {
listen {{ default .Env.NGINX_SCHEME "8080" }};
server_name localhost;
{{ if exists "/certs/nginx-selfsigned.crt" }}
ssl_certificate /certs/nginx-selfsigned.crt;
ssl_certificate_key /certs/nginx-selfsigned.key;
{{ end }}
location / {
proxy_http_version 1.1;
if ($http_authorization != "Bearer {{ .Env.AUTH_TOKEN }}") {
return 401;
}
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_pass {{ default .Env.PROXY_SCHEME "http" }}://{{ .Env.PROXY_ADDR }}:{{ .Env.PROXY_PORT }};
}
}