Skip to content

Commit

Permalink
Ensure that all 404's are redirect to /latest
Browse files Browse the repository at this point in the history
  • Loading branch information
mvriel committed Jan 12, 2020
1 parent 18e32ad commit 2e4f981
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/.static/redirectToLatest.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<title>Please wait ..</title>
<meta http-equiv="refresh" content="0; url = ./latest" />
<meta http-equiv="refresh" content="0; url = /latest" />
</head>
<body>
</body>
Expand Down
2 changes: 2 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

COPY --from=build /data/html /usr/share/nginx/html/$VERSION
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY .static/redirectToLatest.html /usr/share/nginx/html/index.html
COPY .static/redirectToLatest.html /usr/share/nginx/html/404.html

STOPSIGNAL SIGQUIT
15 changes: 15 additions & 0 deletions docs/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 80;
server_name _;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

0 comments on commit 2e4f981

Please sign in to comment.