Files
illustrated-algorithm/nginx.conf
T

30 lines
713 B
Nginx Configuration File
Raw Normal View History

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
gzip_min_length 256;
# Static assets caching
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff2|ttf)$ {
expires 7d;
add_header Cache-Control "public, no-transform";
}
# Auto-index at root for listing available pages
location / {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
# Each subdirectory serves its page
location ~ ^/([^/]+)/ {
try_files $uri $uri/ /$1/index.html;
}
}