ico
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY index.html /usr/share/nginx/html/
|
COPY index.html /usr/share/nginx/html/
|
||||||
|
COPY 404.html /usr/share/nginx/html/
|
||||||
COPY favicon.ico /usr/share/nginx/html/
|
COPY favicon.ico /usr/share/nginx/html/
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|||||||
14
nginx.conf
14
nginx.conf
@@ -4,13 +4,25 @@ server {
|
|||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.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
|
# Enable clean URLs without .html extension
|
||||||
location / {
|
location / {
|
||||||
# Try the exact URI, then with .html, then as directory with index.html, then 404
|
# Try the exact URI, then with .html, then as directory with index.html, then 404
|
||||||
try_files $uri $uri.html $uri/ =404;
|
try_files $uri $uri.html $uri/ =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
location = /index.html {
|
location = /index.html {
|
||||||
try_files /index.html =404;
|
try_files /index.html =404;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user