Здравствуйте как правильно настроить nginx как реверс прокси, в docker, в связке с .net ?
Вообщем задеплоил в docker nginx и .net
docker logs
2019/12/13 10:57:16 [error] 6#6: *9 connect() failed (113: No route to host) while connecting to upstream, client: 110.232.92.44, server: , request: "GET / HTTP/1.1", upstream: "
http://myip:80/", host: "178.88.161.76:8080"
110.232.92.44 - - [13/Dec/2019:10:57:16 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
Но проблема в том что вижу дефолтовую страницу nginx
но не страницу aspnet
.net
dockerfile
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS final
WORKDIR /app
COPY . .
EXPOSE 5000
ENTRYPOINT ["dotnet", "WebApplication4.dll"]
nginx
dockerfile
FROM nginx
COPY nginx.conf /etc/nginx/
nginx.conf
worker_processes 4;
events { worker_connections 1024; }
http {
# Nginx will handle gzip compression of responses from the app server
gzip on;
gzip_proxied any;
gzip_types text/plain application/json;
gzip_min_length 1000;
server {
listen 8080;
# Nginx will reject anything not matching /api
location / {
proxy_pass http://10.2.10.6:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
}
}
}