From 9917209e6083b39c38ea609b97c677520dff126d Mon Sep 17 00:00:00 2001 From: Muthu Kumar Date: Thu, 26 Apr 2018 00:02:58 +0530 Subject: [PATCH] [wiki] Added nginx page --- doc/nginx.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/nginx.md 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