feat: Añadir lógica condicional para la URL de la API CMS y mejorar la configuración de Nginx

This commit is contained in:
2026-03-31 12:55:12 -03:00
parent 2d2ea216e0
commit 212832fdda
2 changed files with 17 additions and 1 deletions
+11
View File
@@ -11,3 +11,14 @@ location /lms-api/ {
proxy_set_header Connection "";
proxy_http_version 1.1;
}
location /cms-api/ {
rewrite ^/cms-api/(.*)$ /$1 break;
proxy_pass http://openccb-studio:3001;
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 $http_x_forwarded_proto;
proxy_set_header Connection "";
proxy_http_version 1.1;
}
+6 -1
View File
@@ -16,7 +16,12 @@ export const getLmsApiUrl = () => {
}
return getApiBaseUrl("3002", process.env.NEXT_PUBLIC_LMS_API_URL);
};
export const getCmsApiUrl = () => getApiBaseUrl("3001", process.env.NEXT_PUBLIC_CMS_API_URL);
export const getCmsApiUrl = () => {
if (typeof window !== 'undefined' && window.location.hostname === 'learning.norteamericano.com') {
return `${window.location.protocol}//learning.norteamericano.com/cms-api`;
}
return getApiBaseUrl("3001", process.env.NEXT_PUBLIC_CMS_API_URL);
};
export const getImageUrl = (path?: string) => {
if (!path) return '';