1
0
mirror of https://github.com/TeamNewPipe/website synced 2025-10-05 16:13:13 +02:00

Custom error pages

This commit is contained in:
TheAssassin
2018-09-11 21:50:28 +02:00
parent b3626df6f8
commit 2af4a7e00c
2 changed files with 29 additions and 2 deletions

View File

@@ -50,13 +50,15 @@ RUN bash -xc "chown -R jekyll: /srv/jekyll && \
RUN ls -al /data /data/img
FROM nginx:1.13-alpine
FROM nginx:alpine
# Disable access logs (if needed, can be fetched from the reverse proxy)
# and also make sure hidden files are not served by NGINX
# TODO the latter doesn't work currently
RUN sed -i 's/access_log.*/access_log off;/' /etc/nginx/nginx.conf && \
sed -i 's/^}/ location ~ \^\/(\\\.) { internal; }\n}/' /etc/nginx/conf.d/default.conf && \
sed -i 's/^}/ application\/rss+xml rss;\n application\/atom+xml;\n}/' /etc/nginx/mime.types
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/
COPY --from=builder /data /usr/share/nginx/html

View File

@@ -0,0 +1,25 @@
server {
listen 80;
server_name localhost;
access_log off;
root /usr/share/nginx/html;
error_page 404 /404.html;
location / {
index index.html index.htm;
}
location ~ ^/(blog|press) {
error_page 404 /$1/404.html;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location ~ /\. {
deny all;
}
}