diff --git a/doc/nginx.md b/doc/nginx.md new file mode 100644 index 0000000..ff6656f --- /dev/null +++ b/doc/nginx.md @@ -0,0 +1,22 @@ +# nginx hacks and snippets + +## Remove .html and rewrite urls + +```text +server { + listen 80; + listen [::]:80; + root ; + index index.html index.htm; + + server_name ; + + # rewrites .html to pretty urls + rewrite ^(/.+)\.html$ $scheme://$host$1 permanent; + + location / { + index index.html index.htm; + try_files $uri.html $uri $uri/ @handler; + } +} +``` \ No newline at end of file