/
nginx.conf
64 lines (50 loc) · 2.23 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
server {
listen 80;
listen [::]:80;
server_name web-standards.ru www.web-standards.ru;
return 301 https://web-standards.ru$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.web-standards.ru;
return 301 https://web-standards.ru$request_uri;
ssl_certificate /etc/letsencrypt/live/web-standards.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/web-standards.ru/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/web-standards.ru/chain.pem;
include snippets/ssl-params.conf;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name web-standards.ru;
root /var/www/web-standards.ru/html;
index index.html index.xml;
error_page 404 /404/;
location ~ /podcast/(cover\.png|feed|episodes/\d+\.mp3) {
root /var/www/web-standards.ru;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' 'https://instantview.telegram.org';
add_header 'Access-Control-Allow-Methods' 'GET';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' 'https://instantview.telegram.org';
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
}
location ~ ^/calendar\.(ics|json)$ {
root /var/www/web-standards.ru/calendar;
add_header 'Access-Control-Allow-Origin' '*';
}
ssl_certificate /etc/letsencrypt/live/web-standards.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/web-standards.ru/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/web-standards.ru/chain.pem;
include snippets/ssl-params.conf;
}