feat: Añadir configuración de Nginx para el API de LMS y ajustar las rutas en el frontend de OpenCCB
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# Custom nginx configuration for OpenCCB Learning
|
||||
# Keep the learning frontend on port 3003 and expose LMS API via same-origin /lms-api.
|
||||
|
||||
location /lms-api/ {
|
||||
rewrite ^/lms-api/(.*)$ /$1 break;
|
||||
proxy_pass http://openccb-experience:3002;
|
||||
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;
|
||||
}
|
||||
+41
-2
@@ -15,6 +15,17 @@ location /cms-api/ {
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
|
||||
location /lms-api/ {
|
||||
rewrite ^/lms-api/(.*)$ /$1 break;
|
||||
proxy_pass http://openccb-experience:3002;
|
||||
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;
|
||||
}
|
||||
|
||||
# Auth pages like GET /auth/login and GET /auth/register must be served by Next.js (3000),
|
||||
# while the auth API endpoints (POST /auth/login, POST /auth/register, /auth/me, /auth/sso/*)
|
||||
# must continue to go to the CMS backend (3001).
|
||||
@@ -222,8 +233,28 @@ location /grading/ {
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
|
||||
location = /question-bank {
|
||||
proxy_pass http://openccb-studio:3000;
|
||||
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;
|
||||
}
|
||||
|
||||
location = /question-bank/ {
|
||||
proxy_pass http://openccb-studio:3000/question-bank;
|
||||
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;
|
||||
}
|
||||
|
||||
location /question-bank/ {
|
||||
proxy_pass http://openccb-studio:3001;
|
||||
proxy_pass http://openccb-studio:3000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -252,8 +283,16 @@ location = /admin/ {
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
|
||||
location = /admin/organizations {
|
||||
return 302 /admin;
|
||||
}
|
||||
|
||||
location = /admin/organizations/ {
|
||||
return 302 /admin;
|
||||
}
|
||||
|
||||
location /admin/ {
|
||||
proxy_pass http://openccb-studio:3001;
|
||||
proxy_pass http://openccb-studio:3000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
Reference in New Issue
Block a user