-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf.template
More file actions
98 lines (85 loc) · 2.79 KB
/
Copy pathnginx.conf.template
File metadata and controls
98 lines (85 loc) · 2.79 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
user nginx;
worker_processes auto;
pid /run/nginx/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_tokens off;
log_format connection_details escape=json '{'
'"time":"$time_iso8601",'
'"remote_addr":"$remote_addr",'
'"remote_user":"$remote_user",'
'"request":"$request",'
'"status":$status,'
'"body_bytes_sent":$body_bytes_sent,'
'"request_time":$request_time,'
'"request_length":$request_length,'
'"bytes_sent":$bytes_sent,'
'"http_referer":"$http_referer",'
'"http_user_agent":"$http_user_agent",'
'"http_x_forwarded_for":"$http_x_forwarded_for",'
'"host":"$host",'
'"server_name":"$server_name",'
'"scheme":"$scheme",'
'"protocol":"$server_protocol",'
'"method":"$request_method",'
'"uri":"$request_uri",'
'"connection":"$connection",'
'"connection_requests":"$connection_requests",'
'"ssl_protocol":"$ssl_protocol",'
'"ssl_cipher":"$ssl_cipher"'
'}';
access_log /var/log/nginx/access.log connection_details;
error_log /var/log/nginx/error.log info;
upstream fingerprint_logger {
server ${FINGERPRINT_LISTEN_HOST}:${FINGERPRINT_LISTEN_PORT};
keepalive 4;
}
sendfile on;
keepalive_timeout 65;
client_max_body_size ${CLIENT_MAX_BODY_SIZE};
server {
listen 80 default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
location ^~ /.well-known/acme-challenge/ {
root /var/www/certbot;
default_type text/plain;
try_files $uri =404;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
ssl_certificate ${TLS_CERTIFICATE};
ssl_certificate_key ${TLS_CERTIFICATE_KEY};
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
location = /fingerprint {
client_body_buffer_size 512k;
proxy_pass http://fingerprint_logger;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 10s;
proxy_send_timeout 10s;
}
location / {
try_files $uri $uri/ /index.html;
}
}
}