generated from avior/template-web-astro
65 lines
1.8 KiB
Nginx Configuration File
65 lines
1.8 KiB
Nginx Configuration File
worker_processes 1;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
server {
|
|
listen 3000;
|
|
listen [::]:3000;
|
|
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm;
|
|
include /etc/nginx/mime.types;
|
|
|
|
gzip on;
|
|
gzip_min_length 1000;
|
|
gzip_proxied expired no-cache no-store private auth;
|
|
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
|
|
error_page 404 /404.html;
|
|
error_page 500 502 503 504 /500.html;
|
|
|
|
location / {
|
|
try_files $uri $uri.html /$uri /index.html;
|
|
}
|
|
|
|
# Plausible script
|
|
location /js/script.js {
|
|
# Change this if you use a different variant of the script
|
|
proxy_pass https://plausible.io/js/script.js;
|
|
proxy_set_header Host plausible.io;
|
|
|
|
# Tiny, negligible performance improvement. Very optional.
|
|
proxy_buffering on;
|
|
}
|
|
|
|
# Plausible script
|
|
location /api/event {
|
|
proxy_pass https://plausible.io/api/event;
|
|
proxy_set_header Host plausible.io;
|
|
proxy_buffering on;
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
}
|
|
|
|
# Media: images, icons, video, audio, HTC
|
|
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webp|webm|htc|woff2|woff)$ {
|
|
expires 1y;
|
|
access_log off;
|
|
}
|
|
|
|
# CSS and Javascript
|
|
location ~* \.(?:css|js)$ {
|
|
expires 1y;
|
|
access_log off;
|
|
}
|
|
}
|
|
}
|