diff --git a/nginx/proxy.conf b/nginx/proxy.conf index b70a7d8..ef0d46a 100644 --- a/nginx/proxy.conf +++ b/nginx/proxy.conf @@ -3,3 +3,9 @@ map $http_x_forwarded_proto $origin_proto { default $http_x_forwarded_proto; "" $scheme; } + +# Map to detect POST to /auth/login +map "$request_uri:$request_method" $cms_login { + default 0; + "~^/auth/login$:POST" 1; +} diff --git a/nginx/studio.norteamericano.com b/nginx/studio.norteamericano.com index bd27f82..e1dc64e 100644 --- a/nginx/studio.norteamericano.com +++ b/nginx/studio.norteamericano.com @@ -1,8 +1,11 @@ -# CMS API routes - ONLY POST /auth/login -# All other routes handled by Next.js rewrites +# CMS API routes - redirect POST /auth/login to CMS -# Auth login - POST goes to CMS API, GET stays on frontend location = /auth/login { + # POST requests go to CMS API (port 3001) + if ($cms_login) { + proxy_pass http://172.18.0.6:3001; + } + # GET requests stay on frontend (port 3000) proxy_pass http://172.18.0.6:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;