简体   繁体   中英

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM