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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 '';
|
||||
|
||||
Reference in New Issue
Block a user