fix: cleanup templates

This commit is contained in:
2022-12-21 14:32:12 +01:00
parent 984ee9f214
commit 70b4899efc
4 changed files with 80 additions and 9 deletions

68
templates/nginx.conf.j2 Normal file
View File

@@ -0,0 +1,68 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
log_format custom '$remote_user [$time_local]'
'"$request" $status $body_bytes_sent'
'"$http_referer" "$http_user_agent"'
'"$request_time" "$upstream_connect_time"';
access_log /var/log/nginx/access.log custom;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_certificate {{ ssl_path }}/fullchain.pem;
ssl_certificate_key {{ ssl_path }}/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers {{ ssl_ciphers }};
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
proxy_cache_path /tmp/nginx.cache.d keys_zone=default_proxy_cache:10m;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include http_include.conf;
server{
listen 80 default;
listen [::]:80 default;
# disable logging
access_log off;
include locations/acme-challenge.conf;
location /{
return 302 https://$host$request_uri;
}
}
}
stream {
ssl_certificate {{ ssl_path}}/fullchain.pem;
ssl_certificate_key {{ ssl_path }}/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers {{ ssl_ciphers }};
include stream_include.conf;
}

View File

@@ -5,11 +5,12 @@ server{
listen 443 ssl;
listen [::]:443 ssl;
{% if servernames %}
server_name {% for s in servernames %} {{ s }} {% endfor %};
{% endif %}
{% if servernames %}server_name{% for s in servernames %} {{ s }}{% endfor %};{% endif %}
include locations/acme-challenge.conf;
proxy_pass http://{{ targetip }}:{{ targetport }};
include acme-challenge.conf;
location / {
proxy_pass http://{{ targetip }}:{{ targetport }};
}
}

View File

@@ -1,10 +1,12 @@
server {
# {{ comment }}
listen {{ portstring }} {% if udp %} udp {% endif %}{% if ssl %} ssl {% endif %};
proxy_pass {{ targetip }}:$server_port;
{% if transparent %} proxy_bind $remote_addr transparent; {% endif }
proxy_timeout 10s;
proxy_responses 1;
proxy_pass {{ targetip }}:$server_port;
{% if transparent %} proxy_bind $remote_addr transparent; {% endif %}
}