Docker as a Proxy server for a web service

My app integrates with a web service that supports a proxy server. So I need to have integration tests that prove that works.

So I wanted to use Docker to create a local proxy server that I can run real integration tests to verify that my web service can be called through the proxy interface without errors.

So I tried https://github.com/jwilder/nginx-proxy

I started up the container with:

docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy

When I use it i get a 503 error 503 Service Temporarily Unavailable

Am I misunderstanding what this proxy does?


Although this has been resolved in the comments, I'll try to answer the following question:

Am I misunderstanding what this proxy does?

Yes. What your project requires, is the availability of a forward-proxy and what you are trying to use, is a reverse-proxy. This will become more clear once you go through the most top rated answers at Difference between proxy server and reverse proxy server

For a TL;DR moment:

在这里输入图像描述

There are many forward-proxy software available. You could choose any one of them for your project. Some of them are:

  • Squid
  • Polipo
  • Apache Traffic Server
  • Privoxy
  • TinyProxy
  • 链接地址: http://www.djcxy.com/p/96428.html

    上一篇: 使用HAProxy设置HTTPs转发代理

    下一篇: Docker作为Web服务的代理服务器