Docker Nginx stopped: [emerg] 1#1: host not found in upstream

后端 未结 3 1154
栀梦
栀梦 2020-12-24 10:55

I am running docker-nginx on ECS server. My nginx service is suddenly stopped because the proxy_path of one of the servers got unreachable. The error is as follows:

3条回答
  •  心在旅途
    2020-12-24 11:40

    Include to prevent Nginx from crashing if your site is down, include a resolver directive, as follows:

     server {
           listen      80;
           server_name     test.com;
           location / {
              resolver 8.8.8.8
              proxy_pass         http://dev-exapmle.io:5016/;
              proxy_redirect     off;
     ...
    

    WARNING! Using a public DNS create a security risk in your backend since your DNS requests can be spoofed. If this is an issue, you should point the resolver to a secure DNS server.

提交回复
热议问题