mirror of https://github.com/MKRhere/wiki
Muthu Kumar
7 years ago
1 changed files with 22 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
# nginx hacks and snippets |
|||
|
|||
## Remove .html and rewrite urls |
|||
|
|||
```text |
|||
server { |
|||
listen 80; |
|||
listen [::]:80; |
|||
root <root_dir>; |
|||
index index.html index.htm; |
|||
|
|||
server_name <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; |
|||
} |
|||
} |
|||
``` |
Loading…
Reference in new issue