web: nginx loest den api-Container pro Request auf (502 nach api-Recreate, #16); renovate.json ohne _comment/_managers (#37)
nginx pinnte die IP von `api` beim Start; wird nur der api-Container neu erzeugt, laeuft jeder
/api-Aufruf auf 502, bis auch web neu startet. `resolver 127.0.0.11 valid=10s` plus proxy_pass
ueber eine Variable laesst nginx den Namen pro Request neu aufloesen.
Renovate lehnte die Konfiguration wegen der Pseudo-Schluessel `_comment` und `_managers` ab
("Invalid configuration option") und hatte die MRs eingestellt; beide Texte stehen jetzt im
offiziellen `description`-Feld.
This commit is contained in:
1 parent
dca6bcdf2d
commit
c78bc6763f
2 files changed
+92
-39
No files matched your search
@@ -20,7 +20,13 @@ server {
|
||||
# as /api/anything.json would be matched by the \.(js|css|json|html)$ block instead and be
|
||||
# looked for on disk rather than proxied.
|
||||
location ^~ /api/ {
|
||||
proxy_pass http://${BACKEND}:${PORT};
|
||||
# Resolved per request through Docker's DNS, not once at start-up: nginx otherwise pins
|
||||
# the api container's IP when it boots, and a recreated api (new IP) means 502 on every
|
||||
# /api call until web is restarted too (issue #16). The variable is what makes nginx
|
||||
# re-resolve; lowercase so the entrypoint's envsubst leaves it alone.
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
set $api_upstream http://${BACKEND}:${PORT};
|
||||
proxy_pass $api_upstream;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
Reference in new issue
Block a user