37 lines
757 B
Nginx Configuration File
37 lines
757 B
Nginx Configuration File
http {
|
|||
|
|
include /etc/nginx/mime.types;
|
||
|
|
default_type application/octet-stream;
|
||
|
|
log_format compression '$remote_addr - $remote_user [$time_local] '
|
||
|
|
'"$request" $status $upstream_addr '
|
||
|
|
'"$http_referer" "$htpp_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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|