Skip to content

Instantly share code, notes, and snippets.

@darmawan01
Created September 5, 2019 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darmawan01/cfa960f6bec517b42c6775363d63ee8b to your computer and use it in GitHub Desktop.
Save darmawan01/cfa960f6bec517b42c6775363d63ee8b to your computer and use it in GitHub Desktop.
Static web ngixn conf
server {
listen 80 default_server;
server_name pasti.id;
root /usr/share/nginx/html;
index index.html;
location ~ ^/(css|js)/ {
expires max;
}
# redirect server error pages / and set response status to 200 / ok
error_page 404 =200 /;
location ~* ^.+\.(html|htm)$ {
expires 5m;
}
location / {
try_files $uri /index.html =404;
}
# deny access to hidden files (beginning with a period)
location ~ /\. {
access_log off; log_not_found off; deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment