The source code

Github.com/zsl10/gin-e…

Deploy the Go service advantage using Nginx

  • Load balancing
  • The reverse proxy
  • Log collection
  • rewrite url
  • High availability

The specific implementation

  • With the Nginx reverse proxy, all HTTP requests will access the GO HTTP service
  • Configure hosts:
127.0.0.1	 dev.gin.example.com
Copy the code
  • Start the service:
Docker-compose up --build-d
2、 docker exec-it demo18_golang_1 bash 3, freshCopy the code
  • Access:
curl dev.gin.example.com:8091/test
ok
Copy the code