Skip to content

Commit

Permalink
Change nginx.conf to listen on port 3000 and fix error_page
Browse files Browse the repository at this point in the history
  • Loading branch information
mooxl committed Oct 24, 2023
1 parent ca7e679 commit 3670343
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions astro/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ http {
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
default_type application/octet-stream;

server {
listen 80;
listen 3000;

location / {
root /usr/share/nginx/html;
try_files $uri $uri/ =404;
Expand All @@ -23,18 +22,20 @@ http {
location /error_page.html {
internal;
}

location ~* \.(jpg|jpeg|png|gif|ico|css|html)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}

location ~* \.js$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
add_header Content-Type application/javascript;
}
error_page 404 /404.html;

error_page 404 /error_page.html;
}
}

0 comments on commit 3670343

Please sign in to comment.