You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
750 B
Plaintext
29 lines
750 B
Plaintext
server {
|
|
# listen on port 80
|
|
listen 80;
|
|
|
|
# where the root here
|
|
root /var/www;
|
|
# what file to server as index
|
|
index index.html index.htm;
|
|
error_page 404 /404/index.html;
|
|
|
|
# Fonts and media: images, icons, video, audio, HTC
|
|
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|ttf)$ {
|
|
expires 1M;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
# Javascript and CSS files
|
|
location ~* \.(?:css|webmanifest|js|woff2|manifest)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
location / {
|
|
# First attempt to serve request as file, then
|
|
# as directory, then fall back to redirecting to index.html
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
}
|