-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
85 lines (67 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
server {
listen 80;
server_name localhost;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';";
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Xss-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin";
if ($host = 'www.walberater.de') {
rewrite ^/(.*)$ https://wahlberater.de/$1 permanent;
}
if ($host = 'walberater.de') {
rewrite ^/(.*)$ https://wahlberater.de/$1 permanent;
}
if ($host = 'www.wahlberater.de') {
rewrite ^/(.*)$ https://wahlberater.de/$1 permanent;
}
location /walberatung {
rewrite ^/(.*)$ https://umfrage.wahlberater.de/index.php/168762?lang=de redirect;
}
location /wahlberatung {
rewrite ^/(.*)$ https://umfrage.wahlberater.de/index.php/168762?lang=de redirect;
}
# users are not supposed to start in the middle of the quiz
location /quiz/ {
rewrite ^/quiz/(.*)$ $scheme://$host/quiz permanent;
}
location /assets/ {
root /usr/share/nginx/html;
expires 1h;
add_header Cache-Control "public";
}
location ~ ^/.*\.[a-f0-9]+\.(css|js)$ {
root /usr/share/nginx/html;
expires 1y;
add_header Cache-Control "public";
}
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
index index.html index.htm index.php;
}
# cache all assets for 12 hours
location /assets/ {
root /usr/share/nginx/html;
expires 12h;
add_header Cache-Control "public";
}
# cache rendered js files for 1 year
location ~ ^/.*\.[a-f0-9]+\.bundle.js$ {
root /usr/share/nginx/html;
expires 1y;
add_header Cache-Control "public";
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}