forked from macbre/docker-nginx-http3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
localhost.conf
75 lines (59 loc) · 1.48 KB
/
localhost.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
73
74
# vim: sw=2 et filetype=nginx
server {
listen 80;
server_name localhost 127.0.0.1 [::1];
location / {
default_type 'text/plain';
expires 0;
return 404 'Retry on https port\n';
}
}
server {
listen 443 ssl;
listen 443 quic reuseport;
http2 on;
http3 on;
server_name localhost 127.0.0.1 [::1];
ssl_certificate 'ssl/cert.pem';
ssl_certificate_key 'ssl/privkey.pem';
ssl_stapling off;
ssl_stapling_verify off;
add_header Alt-Svc 'h3=":443"; ma=86400';
gzip_vary off;
expires 0;
location = / {
default_type 'text/html';
gzip off;
brotli off;
if ($http_user_agent ~* '.*(curl|wget).*') {
return 200 'It works!\nUsing: $server_protocol | $ssl_protocol | $ssl_cipher\n';
}
return 200 '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>It works!</title></head><body><h1>It works!</h1><h1>Using: $server_protocol | $ssl_protocol | $ssl_cipher</h1></body></html>\n';
}
location = /njs/date {
default_type 'text/plain';
js_content http.date;
}
location = /njs/hello {
default_type 'text/plain';
js_content http.hello;
}
location = /njs/version {
default_type 'text/plain';
js_content http.version;
}
location = /test.html {
gzip_static on;
brotli_static on;
}
location = /test_brotli.html {
gzip_static off;
}
location = /test_gzip.html {
brotli_static off;
}
location = /health {
default_type 'text/plain';
return 200 'healthy\n';
}
}