Update nginx.conf with simplified file paths and error page configurations

This commit is contained in:
Max Schmidt 2023-10-24 10:23:36 +02:00
parent 5400495176
commit 46e53c7623

View File

@ -1,9 +1,9 @@
worker_processes 1;
events { events {
worker_connections 1024; worker_connections 1024;
} }
http { http {
include /etc/nginx/mime.types; include mime.types;
default_type application/octet-stream; default_type application/octet-stream;
gzip on; gzip on;
gzip_vary on; gzip_vary on;
@ -17,21 +17,17 @@ http {
listen 80; listen 80;
location / { location / {
root /usr/share/nginx/html; root html;
try_files $uri $uri/ =404; index index.html index.htm;
} }
location /error_page.html { #error_page 404 /404.html;
internal;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js|htm|html)$ { # redirect server error pages to the static page /50x.html
root /usr/share/nginx/html; #
expires 30d; error_page 500 502 503 504 /50x.html;
add_header Pragma public; location = /50x.html {
add_header Cache-Control "public"; root html;
} }
error_page 404 /error_page.html;
} }
} }