diff --git a/docker-compose.yml b/docker-compose.yml index d19870a..9b78aed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,7 @@ services: - vhost:/etc/nginx/vhost.d - html:/usr/share/nginx/html - ./nginx/proxy.conf:/etc/nginx/conf.d/proxy.conf:ro + - ./nginx/studio-api-location.conf:/etc/nginx/vhost.d/studio.norteamericano.com_location:ro restart: always networks: - openccb-network diff --git a/nginx/proxy.conf b/nginx/proxy.conf index b70a7d8..1145dc9 100644 --- a/nginx/proxy.conf +++ b/nginx/proxy.conf @@ -3,3 +3,12 @@ map $http_x_forwarded_proto $origin_proto { default $http_x_forwarded_proto; "" $scheme; } + +# Location for CMS API routes - redirect to CMS service (port 3001) +location ~ ^/(auth|courses|modules|lessons|assets|organization|branding|users|admin|question-bank|test-templates|knowledge-base|api|webhooks|grading|libraries|rubrics|learning-sequences|audit-logs|analytics|webhooks|cohorts|announcements|submissions|peer-reviews|instructors|token-usage|sam|embeddings) { + proxy_pass http://openccb-cms: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 $scheme; +} diff --git a/nginx/studio-api-location.conf b/nginx/studio-api-location.conf new file mode 100644 index 0000000..43d75bd --- /dev/null +++ b/nginx/studio-api-location.conf @@ -0,0 +1,11 @@ +# CMS API routes - redirect to CMS service (port 3001) +location ~ ^/(auth|courses|modules|lessons|assets|organization|branding|users|admin|question-bank|test-templates|knowledge-base|api|webhooks|grading|libraries|rubrics|learning-sequences|audit-logs|analytics|cohorts|announcements|submissions|peer-reviews|instructors|token-usage|sam|embeddings|health) { + 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 $origin_proto; + proxy_set_header X-Forwarded-Ssl on; + proxy_set_header Connection ""; + proxy_http_version 1.1; +}