From 3f5c8562dde3b3e44114f7a75c2b9c5ab3ddd6c6 Mon Sep 17 00:00:00 2001 From: "John A. Hoeven" Date: Mon, 20 Jul 2026 00:20:44 +0200 Subject: [PATCH] =?UTF-8?q?Add=20tracked=20nginx=20reverse-proxy=20templat?= =?UTF-8?q?e=20for=20llama-server=20=E2=80=94=20previously=20only=20existe?= =?UTF-8?q?d=20as=20a=20heredoc=20run=20live=20on=20BigBoy;=20also=20resol?= =?UTF-8?q?ves=20the=20server=5Fname=20wildcard=20conflict=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/templates/llama.conf.j2 | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ansible/templates/llama.conf.j2 diff --git a/ansible/templates/llama.conf.j2 b/ansible/templates/llama.conf.j2 new file mode 100644 index 0000000..41470a3 --- /dev/null +++ b/ansible/templates/llama.conf.j2 @@ -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; + } +} \ No newline at end of file