summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Porte <microjoe@microjoe.org>2017-08-04 22:07:19 +0200
committerRomain Porte <microjoe@microjoe.org>2017-08-04 22:07:19 +0200
commit56743c603e20d48b7aaf75f6279fc8f484e4d552 (patch)
treec6d2ffd42163c52692d70934f3c46026889151b4
parent77030e1b2505fc5d2d0bb54bc6aba986d4f36fb3 (diff)
downloadMicroJoe.nginx-staticwebsite-56743c603e20d48b7aaf75f6279fc8f484e4d552.tar.gz
MicroJoe.nginx-staticwebsite-56743c603e20d48b7aaf75f6279fc8f484e4d552.zip
Half-working html removal
-rw-r--r--templates/nginx.j27
1 files changed, 5 insertions, 2 deletions
diff --git a/templates/nginx.j2 b/templates/nginx.j2
index 47454bf..fa2f238 100644
--- a/templates/nginx.j2
+++ b/templates/nginx.j2
@@ -37,11 +37,14 @@ server {
{% endif %}
root {{ nginx_root }};
- index index.html index.htm index.nginx-debian.html;
+
+ index index.html;
location / {
{% if nginx_rewrite_html %}
- try_files $uri.html $uri/ =404;
+ rewrite ^(/.+)\.html$ $1;
+ try_files $uri.html $uri $uri/ =404;
+ default_type text/html;
{% else %}
try_files $uri $uri/ =404;
{% endif %}