modified: serv_nginx/nginx/nginx-ssl.conf
modified: yalarba/serv_golang_rest_api/internal/server/server.go add setting and change path for url
This commit is contained in:
@@ -41,6 +41,19 @@ server {
|
||||
proxy_read_timeout 600;
|
||||
}
|
||||
|
||||
# New location for REST API
|
||||
location /api/ {
|
||||
proxy_pass http://localhost:8888/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_connect_timeout 600;
|
||||
proxy_send_timeout 600;
|
||||
proxy_read_timeout 600;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
|
||||
@@ -36,7 +36,7 @@ func (s *Server) configureRouter(db *gorm.DB) {
|
||||
s.router.Get("/health", s.healthCheck)
|
||||
|
||||
// API routes
|
||||
s.router.Route("/api/v1", func(r chi.Router) {
|
||||
s.router.Route("/v1", func(r chi.Router) {
|
||||
s.setupUserRoutes(r, db)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user