-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebapp.conf.example
More file actions
43 lines (43 loc) · 1.69 KB
/
webapp.conf.example
File metadata and controls
43 lines (43 loc) · 1.69 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
upstream proxy-internal {
# change localhost to your server
server localhost:8081 max_fails=1 fail_timeout=10s;
}
error_log /dev/null crit;
access_log /dev/null;
client_body_timeout 10s;
client_header_timeout 10s;
# change this for running version to volume in docker compose
proxy_cache_path /data/nginx/cache keys_zone=mycache:10m;
proxy_cache_valid any 15m;
server {
# the listen port is the port we expose in docker-compose
listen 8443 ssl http2;
listen [::]:8443 ssl http2;
server_name nginx-proxy-internal;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_timeout 1d;
# need to have path to correct certs
ssl_certificate /etc/nginx/ssl/nginx.cert;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
# New root location
proxy_cache mycache;
#none of this needs to be changed for our purposes
location / {
proxy_pass https://proxy-internal;
proxy_ssl_name nginx-proxy-internal;
proxy_redirect off;
# change to real proxy header in production
proxy_set_header Host localhost;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ssl_session_reuse on;
proxy_ssl_server_name on;
proxy_ssl_verify off;
proxy_http_version 1.1;
}
# You may need this to prevent return 404 recursion.
location = /404.html {
internal;
}
}