Add tracked nginx reverse-proxy template for llama-server — previously only existed as a heredoc run live on BigBoy; also resolves the server_name wildcard conflict warning

This commit is contained in:
John A. Hoeven 2026-07-20 00:20:44 +02:00
commit 3f5c8562dd
Signed by: giovannino
GPG key ID: 306E507219506D4E

View file

@ -0,0 +1,39 @@
# llama.conf — nginx reverse proxy for BigBoy's llama-server
#
# This is a Jinja2 template (Ansible's `template` module convention),
# ready to use once Phase 5 is formalized into an actual Ansible role.
# Until then, it's the tracked, reproducible reference for what's
# actually configured live on BigBoy — this previously existed only as
# a heredoc typed directly during the deployment session, never
# committed anywhere.
#
# Manual deployment (until this is wired into a real Ansible role):
# 1. Fill in the Jinja2 variables below with their actual values
# 2. Copy the rendered result to /etc/nginx/conf.d/llama.conf
# 3. sudo nginx -t (confirm syntax before reloading)
# 4. sudo systemctl reload nginx
#
# NOTE on server_name: the first live deployment used `server_name _;`
# (the catch-all wildcard) and hit a harmless-but-noisy warning —
# "conflicting server name "_" on 0.0.0.0:80, ignored" — because
# AlmaLinux's stock nginx package already ships its own default catch-all
# server block using the same wildcard. This template uses the actual
# host IP instead, avoiding the duplicate entirely rather than just
# tolerating the warning.
server {
listen 80;
server_name {{ ip_address }};
location / {
proxy_pass http://{{ llama_server_host }}:{{ llama_server_port }};
# Required for llama-server's streaming (server-sent event)
# responses — without these, chat responses arrive all at once
# instead of streaming token-by-token.
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
proxy_read_timeout 300s;
}
}