events {} http { server { listen 7860; location / { # Check the Bearer token if ($http_authorization != "Bearer ${ACCESS_TOKEN}") { return 401 "Unauthorized: Invalid ACCESS_TOKEN\n"; } proxy_pass http://127.0.0.1:11434; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } }