diff --git a/Dockerfile b/Dockerfile index c8f9235..1e3c255 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM nginx:alpine COPY index.html /usr/share/nginx/html/ +COPY 404.html /usr/share/nginx/html/ COPY favicon.ico /usr/share/nginx/html/ COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/nginx.conf b/nginx.conf index 2335336..ad2fb87 100644 --- a/nginx.conf +++ b/nginx.conf @@ -4,13 +4,25 @@ server { root /usr/share/nginx/html; index index.html; + # Favicon + location = /favicon.ico { + try_files /favicon.ico =204; + access_log off; + log_not_found off; + } + + # Custom 404 page + error_page 404 /404.html; + location = /404.html { + internal; + } + # Enable clean URLs without .html extension location / { # Try the exact URI, then with .html, then as directory with index.html, then 404 try_files $uri $uri.html $uri/ =404; } - location = /index.html { try_files /index.html =404; }