Update Swagger host to port 5005 and harden Gin trusted proxies.
Also add shared nginx config for test.webulgam.com with online-backend path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,6 +25,14 @@ func New(cfg *config.Config, client *pgxpool.Pool, logger *logging.Logger) *gin.
|
||||
}
|
||||
|
||||
router := gin.New()
|
||||
// Trust only loopback and private networks (Docker/K8s/nginx), not all proxies.
|
||||
_ = router.SetTrustedProxies([]string{
|
||||
"127.0.0.1",
|
||||
"::1",
|
||||
"10.0.0.0/8",
|
||||
"172.16.0.0/12",
|
||||
"192.168.0.0/16",
|
||||
})
|
||||
router.Use(gin.Recovery(), gin.Logger())
|
||||
router.Use(cors.New(cors.Config{
|
||||
AllowOrigins: []string{"*"},
|
||||
|
||||
Reference in New Issue
Block a user