Files
blog-ahmza-com/nginx.conf
T

37 lines
757 B
Nginx Configuration File
Raw Normal View History

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
2021-12-08 22:52:54 +00:00
'"$http_referer" "$http_user_agent"';
server {
listen 80;
access_log /var/log/nginx/access.log compression;
root /var/www;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location ~ ^.+\..+$ {
try_files $uri =404;
}
}
}