wiki:avoid_upstream_not_found_nginx_using_only_one_server
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
wiki:avoid_upstream_not_found_nginx_using_only_one_server [2023/03/30 14:52] – created antisa | wiki:avoid_upstream_not_found_nginx_using_only_one_server [2023/04/18 12:34] (current) – add docker tag, formatting antisa | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{tag> | + | {{tag> |
====== Avoid upstream not found in nginx when using only one upstream server ====== | ====== Avoid upstream not found in nginx when using only one upstream server ====== | ||
Line 7: | Line 7: | ||
server { | server { | ||
listen 80; | listen 80; | ||
+ | resolver 127.0.0.11 valid=30s; # docker' | ||
set $target " | set $target " | ||
- | location / { proxy_pass $target; } | + | location / { |
+ | | ||
+ | | ||
} | } | ||
</ | </ | ||
This will not error out if the target-host is not available (for example in some Docker setup). | This will not error out if the target-host is not available (for example in some Docker setup). | ||
+ | |||
+ | <WRAP center round help 60%> | ||
+ | resolver is probably needed even when the target host is not a docker container | ||
+ | </ | ||
The following example however will give you an error if the target-host can not be resolved: | The following example however will give you an error if the target-host can not be resolved: |
wiki/avoid_upstream_not_found_nginx_using_only_one_server.1680180771.txt.gz · Last modified: 2023/03/30 14:52 by antisa