aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-06-24 15:39:47 +0300
committerJan Tuomi <jan@jantuomi.fi>2025-06-24 15:39:47 +0300
commit099c8cba8a318887840b91ffd61a95598016b704 (patch)
tree9a63e9a3d72a80c8aad729445305d9910c8d9ee6 /templates
parent48db9ffeb402ce670ef8283d4ca211d4299ea058 (diff)
Start working on host reverse proxy
Diffstat (limited to 'templates')
-rw-r--r--templates/usr_local_etc_nginx_nginx.conf.j237
1 files changed, 37 insertions, 0 deletions
diff --git a/templates/usr_local_etc_nginx_nginx.conf.j2 b/templates/usr_local_etc_nginx_nginx.conf.j2
new file mode 100644
index 0000000..f81a82c
--- /dev/null
+++ b/templates/usr_local_etc_nginx_nginx.conf.j2
@@ -0,0 +1,37 @@
+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 jail in jails -%}
+ server {
+ listen 80;
+ server_name {{ jail.name }}.local.jan.systems;
+
+ location / {
+ proxy_pass http://{{ jail.ip }};
+ 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 %}
+}