forked from kubesphere/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
28 lines (21 loc) · 881 Bytes
/
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
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
location ~ /([A-Za-z0-9_-]+)(/[A-Za-z0-9_.-]+)*$ {
if ($args = "go-get=1") {
return 200 '<html><head>\n\t<meta name="go-import" content="$host/$1 git https://github.com/kubesphere/$1">\n\t<meta name="go-source" content="$host/$1 https://github.com/kubesphere/$1 https://github.com/kubesphere/$1/tree/master/{/dir} https://github.com/kubesphere/$1/blob/master/{/dir}/{/file}#L{/line}">\n</head></html>\n';
}
}
}
#error_page 404 /404.html;
# 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;
}
}