-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
72 lines (64 loc) · 1.97 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
68
69
70
71
72
limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;
limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=5r/s;
limit_req_status 444;
limit_conn_status 503;
log_format postdata '$remote_addr [$time_local] "$http_user_agent" $request_body';
server {
listen 80;
listen [::]:80;
server_name dvb.peppnet.de;
include acme_chellenge.conf;
limit_conn conn_limit_per_ip 10;
limit_req zone=req_limit_per_ip burst=10 nodelay;
location / {
rewrite ^(.*) https://$server_name$1 permanent;
}
}
server {
listen 127.0.0.1:443 ssl http2;
# listen [::]:443 ssl http2;
server_name dvb.peppnet.de;
include certificate_gamma.peppnet.de.conf;
include proper_ssl.conf;
limit_conn conn_limit_per_ip 10;
limit_req zone=req_limit_per_ip burst=10 nodelay;
access_log /var/log/nginx/access.dvb.log;
error_log /var/log/nginx/error.dvb.log;
root /var/www/dvb/;
index index.html;
gzip off;
gzip_static on;
gzip_vary on;
etag on;
expires 1h;
charset utf-8;
try_files $uri $uri/index.html /index.html;
location /static/ {
expires 30d;
add_header Cache-Control public;
access_log off;
log_not_found off;
# add_header Last-Modified "";
# add_header ETag "";
break;
}
location = /log {
if ($request_method != POST) {
return 405;
}
proxy_redirect off;
proxy_ssl_server_name on;
proxy_pass $scheme://$server_name:$server_port/success;
access_log /var/log/nginx/postdata.dvb.log postdata;
client_max_body_size 1m;
client_body_buffer_size 1m;
client_body_in_single_buffer on;
# add_header Access-Control-Allow-Origin "$scheme://$server_name:$server_port";
add_header Access-Control-Allow-Origin "*";
}
location = /success {
# turn off logging here to avoid double logging
access_log off;
return 200;
}
}