forked from elementary/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
127 lines (115 loc) · 2.7 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
server {
server_name www.elementary.io;
listen 80;
listen [::]:80;
location / {
return 301 http://elementary.io$request_uri;
}
}
server {
server_name elementary.io;
listen 80;
listen [::]:80;
root /var/www/io.elementary/master;
index index.html index.htm index.php;
error_page 403 /403.php;
error_page 404 /404.php;
error_page 410 /410.php;
location / {
rewrite "^/([a-z]{2}(?:_[A-Z]{2})?)/(.*)$" /$2?lang=$1 last;
try_files $uri $uri.html $uri/ @extensionless-php;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/run/php/website-master.sock;
fastcgi_index index.php;
fastcgi_param PHPENV "production";
fastcgi_param SCRIPT_FILENAME /var/www/io.elementary/master/$fastcgi_script_name;
fastcgi_intercept_errors on;
}
include /etc/nginx/mime.types;
types {
text/x-markdown md;
}
location /docs {
try_files $uri /docs/_mdr/index.php?$args;
}
location = /docs/getting-started {
return 301 https://docs.elementary.io/develop;
}
location ~ /\. {
deny all;
}
location ~ /\_ {
deny all;
}
location ~ /node_modules {
deny all;
}
location ~* \.(html|css|js|png|jpg|jpeg|gif|ico|svg|eot|woff|ttf|json)$ { expires max; }
location = /data/chart.json {
expires 1h;
add_header Cache-Control "public";
}
location /download {
return 301 /;
}
location /store {
return 301 http://store.elementary.io/;
}
location /payment {
return 301 /;
}
location /blog {
return 301 http://blog.elementary.io/;
}
location /journal {
return 301 http://blog.elementary.io/;
}
location = /develop {
return 301 /developer;
}
location = /developers {
return 301 /developer;
}
location /docs/human-interface-guidelines {
return 301 https://docs.elementary.io/hig;
}
location /docs/code/reporting-bugs {
return 301 /docs/code/reference#reporting-bugs;
}
location = /loki {
return 301 http://blog.elementary.io/post/147637979911/loki-04-stable-release;
}
location /installation {
return 301 /docs/installation;
}
location /docs/user-guide {
return 301 /docs/learning-the-basics;
}
location /answers {
return 301 /support;
}
location /support/ {
return 301 /support;
}
location /funding {
return 301 "/get-involved#funding";
}
location /privacy-policy {
return 301 "/privacy";
}
location = /lists {
deny all;
}
location = /lists/packages {
return 301 http://us14.campaign-archive1.com/home/?u=6815d99e5893b4e213cdb00d2&id=db4e281d16;
}
location = /generate_204 {
keepalive_timeout 0;
return 204;
}
}