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:
2026-08-07 18:47:30 +05:00
parent 30bcfefc1e
commit ba53b5b5c2
7 changed files with 98 additions and 9 deletions

View File

@@ -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{"*"},