Created
September 5, 2019 16:19
-
-
Save darmawan01/cfa960f6bec517b42c6775363d63ee8b to your computer and use it in GitHub Desktop.
Static web ngixn conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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