mirror of
https://github.com/TeamNewPipe/website
synced 2025-10-05 16:13:13 +02:00
Custom error pages
This commit is contained in:
@@ -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
|
||||
|
25
docker/nginx/conf.d/default.conf
Normal file
25
docker/nginx/conf.d/default.conf
Normal 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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user