-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathNGINX
More file actions
52 lines (43 loc) · 1.45 KB
/
Copy pathNGINX
File metadata and controls
52 lines (43 loc) · 1.45 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
server {
server_name ai-declaration.md www.ai-declaration.md;
root /var/www/AI-DECLARATION.md/site/public;
index index.html;
location /.well-known/ {
try_files $uri =404;
}
location = /api/ {
try_files /api/index.html =404;
}
location /api/ {
proxy_pass https://api.ai-declaration.md;
proxy_set_header Host api.ai-declaration.md;
proxy_ssl_server_name on;
}
location = / {
add_header Cache-Control "no-store, no-cache, must-revalidate";
return 302 /en/0.1.2/;
}
location ~ "^/[a-z]{2}(-[a-z]{2,4})?/" {
try_files $uri $uri/ /errors/error.html;
}
location / {
try_files $uri $uri/ @fallback;
}
location @fallback {
add_header Cache-Control "no-store, no-cache, must-revalidate";
return 302 /en/0.1.2/;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ai-declaration.md/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ai-declaration.md/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = ai-declaration.md) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name ai-declaration.md www.ai-declaration.md;
return 404; # managed by Certbot
}