nginx: Fix 404 page.

This commit is contained in:
William Floyd 2023-07-17 14:10:41 -05:00
parent 7844028dd6
commit 76ab8a58d1
Signed by untrusted user who does not match committer: william
GPG key ID: B3EEEDD81893CAF9
3 changed files with 16 additions and 17 deletions

View file

@ -2,4 +2,4 @@ FROM klakegg/hugo:onbuild AS hugo
FROM nginx:alpine-slim
COPY --from=hugo /target /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
COPY default.conf /etc/nginx/conf.d/default.conf

15
default.conf Normal file
View file

@ -0,0 +1,15 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View file

@ -1,16 +0,0 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
server {
root /usr/share/nginx/html;
location / {
error_page 404 /404.html;
}
}
}