Skip to content

Commit

Permalink
Update nginx.conf with simplified file paths and error page configura…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
mooxl committed Oct 24, 2023
1 parent 5400495 commit 46e53c7
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions astro/nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}
}

0 comments on commit 46e53c7

Please sign in to comment.