mirror of
https://github.com/kubesphere/website.git
synced 2025-12-25 15:32:54 +00:00
fix go vanity urls
This commit is contained in:
parent
cfe32d5be2
commit
b8f72a640b
|
|
@ -1,2 +1,3 @@
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY public/ /usr/share/nginx/html/
|
COPY public/ /usr/share/nginx/html/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue