blob: 55c55df9eefa8c0b2c5b0d1da88a64d5a2178faa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
worker_processes auto;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80 default_server;
server_name _;
location / {
return 404;
}
}
{% for site in static_sites -%}
{% if site.tls -%}
{#server {
listen 443 ssl;
server_name {{ site.host }};
root /usr/local/www/{{ site.site }};
index index.html;
location / {
try_files $uri $uri.html $uri/ =404;
}
access_log /var/log/nginx/{{ site.site }}/access.log;
error_log /var/log/nginx/{{ site.site }}/error.log;
ssl_certificate /usr/local/etc/letsencrypt/live/{{ site.host }}/fullchain.pem;
ssl_certificate_key /usr/local/etc/letsencrypt/live/{{ site.host }}/privkey.pem;
include /usr/local/etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem;
}
#}
{% endif -%}
server {
listen 80;
server_name {{ site.host }};
return 301 https://$host$request_uri;
access_log /var/log/nginx/{{ site.site }}/access.log;
error_log /var/log/nginx/{{ site.site }}/error.log;
}
{% endfor -%}
{% for jail in jails -%}
server {
listen 80;
server_name {{ jail.name }}.jan.systems {{ jail.name }}.local.jan.systems;
location / {
proxy_pass http://192.168.2.{{ jail.num }};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
{% endfor %}
}
|