aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Dybiec <pawel.to.malpa@gmail.com>2019-05-23 22:01:32 +0200
committerPaweł Dybiec <pawel.to.malpa@gmail.com>2019-05-23 22:01:32 +0200
commit8b46ea3618b100fc873fc694721afa53319d17d0 (patch)
tree51e7ed87c2b647e88b2b509051353c1bbcecdded
parentForce https on main domain (diff)
Formatting
-rw-r--r--templates/nginx.conf.j23
1 files changed, 3 insertions, 0 deletions
diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2
index 724bf32..be3203d 100644
--- a/templates/nginx.conf.j2
+++ b/templates/nginx.conf.j2
@@ -7,6 +7,7 @@ server {
{% endif %}
server {
+
{% if server.http_redirect is not defined or not server.http_redirect %}
listen 80;
{% endif %}
@@ -14,10 +15,12 @@ server {
server_name {{ server.name }};
location / {
+
{% if server.dir is defined %}
root {{ server.dir }};
index index.html;
{% endif %}
+
{% if server.proxy is defined %}
proxy_pass http://{{server.proxy.host|default("localhost")}}:{{server.proxy.port|default("80")}};
proxy_set_header X-Real-IP $remote_addr;