infrastructure/ansible/roles/gateway/files/nginx.conf
Jake Howard 808e72553b
Some checks failed
/ ansible (push) Has been cancelled
/ terraform (push) Has been cancelled
Add the basics of some edge caching
2024-02-21 21:42:16 +00:00

26 lines
798 B
Nginx Configuration File

log_format gateway '$remote_addr [$time_local] '
'$protocol $status $bytes_sent $bytes_received '
'$session_time "$ssl_preread_server_name" '
'"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';
log_format ips '$remote_addr [$time_local] $ssl_preread_server_name';
access_log /var/log/nginx/gateway.log gateway;
access_log /var/log/nginx/ips.log ips;
map $ssl_preread_server_name $gateway_destination {
default {{ wireguard.clients.ingress.ip }}:8443;
headscale.jakehoward.tech 127.0.0.1:8888;
{% for domain in cdn_domains %}
{{ domain }} 127.0.0.1:8800;
{% endfor %}
}
server {
listen 443;
listen 8448;
proxy_pass $gateway_destination;
proxy_protocol on;
}