Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Nginx sample is not working #428

Open
mpcmarcos opened this issue Apr 30, 2020 · 3 comments
Open

Nginx sample is not working #428

mpcmarcos opened this issue Apr 30, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@mpcmarcos
Copy link

mpcmarcos commented Apr 30, 2020

I'm testing with Mac the nginx sample and it's not working. The nginx image is stopped few seconds later to start.

Log:

2020/04/30 18:31:17 [emerg] 1#1: host not found in upstream "appA" in /etc/nginx/conf.d/default.conf:5
nginx: [emerg] host not found in upstream "appA" in /etc/nginx/conf.d/default.conf:5
@rynowak rynowak added the bug Something isn't working label May 1, 2020
@rynowak
Copy link
Member

rynowak commented May 1, 2020

I can reproduce this except the nginx image doesn't crash on me.

@rynowak
Copy link
Member

rynowak commented May 1, 2020

I was able to work around this by adding a resolver to nginx.conf this seems like a behavior difference between docker on windows and docker on macOS.

server {
    listen 80;

    location /A {
        resolver 127.0.0.11;
        proxy_pass http://appA/;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection keep-alive;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }

    location /B {
        resolver 127.0.0.11;
        proxy_pass http://appB/;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection keep-alive;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }
}

I can also confirm that 127.0.0.11 is in /etc/resolv.conf so I'm not sure why this isn't just working.

@rynowak
Copy link
Member

rynowak commented May 1, 2020

@davidfowl

@jkotalik jkotalik added this to the next sprint planning milestone Jul 9, 2020
@tmds tmds mentioned this issue Apr 19, 2021
@philliphoff philliphoff removed this from the next sprint planning milestone Sep 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants