This repository was archived by the owner on Jul 13, 2023. It is now read-only.
forked from willem-delbare/docker-lets-encrypt-proxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
67 lines (56 loc) · 1.74 KB
/
nginx.conf
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Drop privileges
user nobody nobody;
# One worker per core, many connections per worker
worker_processes auto;
events {
worker_connections 19000;
}
# Each connection needs one filehandle, or two if we miss cache
worker_rlimit_nofile 20000;
http {
include conf/mime.types;
include headers.conf;
include tls-http.conf;
include tls-letsencrypt-http.conf;
default_type application/octet-stream;
# Logging to standard outputs for docker
log_format main '$time_iso8601 $remote_addr "$request" '
'$upstream_cache_status $status $request_time $bytes_sent $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
error_log /dev/stderr info;
access_log /dev/stdout main buffer=4096 flush=1s;
# Compress all content when client supports it. Unfortunately nginx
# is not smart enough to store cache content pre-compressed.
gzip on;
gzip_comp_level 1;
gzip_types *;
gzip_proxied any;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2;
include tls-server.conf;
include tls-letsencrypt-server.conf;
# Reverse proxy
location / {
proxy_http_version 1.1;
client_max_body_size 0;
proxy_buffering off;
proxy_request_buffering off;
proxy_set_header Proxy "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_pass ${ORIGIN_HOST};
}
}
server {
listen 80 ;
listen [::]:80;
include tls-letsencrypt-acme.conf;
server_name _;
# Redirect all traffic to TLS
location / {
return 301 https://$host$request_uri;
}
}
}