fix: Always redirect to landing page on 404

Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss 2022-12-12 18:29:45 +01:00
parent 321742632c
commit 4ef8e110cd
Signed by: c8h4
GPG key ID: 6817E9C75C0785D7

View file

@ -13,15 +13,19 @@ RUN sed -i -r \
RUN echo $'\
server {\
listen 80;\
listen [::]:80;\
server_name localhost;\
listen 80;\
listen [::]:80;\
server_name _;\
root /var/www/html;\
try_files /index.html =404;\
try_files $uri $uri/index.html @redirect;\
\
location ~ ^/(favicon.ico|robots.txt)$ {\
access_log off;\
}\
\
location @redirect {\
return 301 $scheme://$http_host;\
}\
}\
' >/etc/nginx/conf.d/default.conf