This is a simple example of a reverse proxy that uses HTTPS and SSL SNI writen in go
- Generate the certificates running the initKey.sh script. This script also modifies /etc/hosts, so it needs to be run as sudo
- Now you can use docker-compose. To check out the reverse proxy, run docker-compose up. It'll create a docker image and start
- Go to the browser and access https://localhost1:8000 and https://localhost2:8000
- By default the reverse proxy on docker listen on port 8000 and the backend servers on 8080 and 8081
- Repeat the first instruction above to generate the certificates
- go run proxy/proxy.go to run the reverse proxy
- go run service1/app.go and go run service2/app.go to run the backend services
- Go to the browser and access https://localhost1:8000 and https://localhost2:8000
This project uses config.yaml as input to specify port for reverse proxy and path to certificates
- go test ./proxy -v