From 46e53c76238b4269c949b1f2c22f4aa0c420a6fe Mon Sep 17 00:00:00 2001 From: Max Schmidt Date: Tue, 24 Oct 2023 10:23:36 +0200 Subject: [PATCH] Update nginx.conf with simplified file paths and error page configurations --- astro/nginx.conf | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/astro/nginx.conf b/astro/nginx.conf index c1f432d..0119f83 100644 --- a/astro/nginx.conf +++ b/astro/nginx.conf @@ -1,9 +1,9 @@ +worker_processes 1; events { worker_connections 1024; } - http { - include /etc/nginx/mime.types; + include mime.types; default_type application/octet-stream; gzip on; gzip_vary on; @@ -16,22 +16,18 @@ http { server { listen 80; - location / { - root /usr/share/nginx/html; - try_files $uri $uri/ =404; + location / { + root html; + index index.html index.htm; } - location /error_page.html { - internal; - } + #error_page 404 /404.html; - location ~* \.(jpg|jpeg|png|gif|ico|css|js|htm|html)$ { - root /usr/share/nginx/html; - expires 30d; - add_header Pragma public; - add_header Cache-Control "public"; + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; } - - error_page 404 /error_page.html; } } \ No newline at end of file