User Tools

Site Tools


wiki:avoid_upstream_not_found_nginx_using_only_one_server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revisionBoth sides next revision
wiki:avoid_upstream_not_found_nginx_using_only_one_server [2023/03/30 14:52] – created antisawiki:avoid_upstream_not_found_nginx_using_only_one_server [2023/03/30 16:09] – [Avoid upstream not found in nginx when using only one upstream server] add resolver info antisa
Line 7: Line 7:
 server { server {
   listen 80;   listen 80;
 +  resolver 127.0.0.11 valid=30s; # docker's resolver
   set $target "http://target-host:3005";  # variable definition   set $target "http://target-host:3005";  # variable definition
   location / { proxy_pass $target; }   location / { proxy_pass $target; }
Line 13: Line 14:
  
 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
 +</WRAP>
  
 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.txt · Last modified: 2023/04/18 12:34 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki