add vhost
This commit is contained in:
29
vhosts.conf
Normal file
29
vhosts.conf
Normal file
@ -0,0 +1,29 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name /usr/share/nginx/html;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
|
||||
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
|
||||
expires -1;
|
||||
# access_log logs/static.log; # I don't usually include a static log
|
||||
}
|
||||
|
||||
location ~* \.(?:css|js|json)$ {
|
||||
try_files $uri =404;
|
||||
expires 1y;
|
||||
access_log off;
|
||||
add_header Cache-Control "public";
|
||||
}
|
||||
|
||||
# Any route containing a file extension (e.g. /devicesfile.js)
|
||||
location ~ ^.+\..+$ {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Any route that doesn't have a file extension (e.g. /devices)
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user