Hi there,
First of all I’m not sure, but I strongly believe that, we getting CORS problem, due to differences between HOST and URLS.
I’m working to implement some MFE from Open edX, via plugins. I have been faced CORS header problem several times. In my opinion, if we can find solutions for rendering Api URLs, which is different from each other(see DISCOVERY_API_BASE_URL).I believe CORS problem will be solved.
It’s possible to EXPOSE to different PORTS with Plugins/Dockerfile, and Nginx, or .ENV files, but it’s mismatch to applications ORIGIN and URLs, I believe.
Here some examples from Frontend-app-publisher
Open edX development
NODE_ENV=‘development’
PORT=18400
BASE_URL=‘http://localhost:18400’
LMS_BASE_URL=‘http://localhost:18000’
STUDIO_BASE_URL=‘http://localhost:18010’
DISCOVERY_API_BASE_URL='http://localhost:18381’
LOGIN_URL=‘http://localhost:18000/login’
LOGOUT_URL=‘http://localhost:18000/logout’
CSRF_TOKEN_API_PATH=‘/csrf/api/v1/token’
REFRESH_ACCESS_TOKEN_ENDPOINT=‘http://localhost:18000/login_refresh’
ACCESS_TOKEN_COOKIE_NAME=‘edx-jwt-cookie-header-payload’
USER_INFO_COOKIE_NAME=‘edx-user-info’
SITE_NAME='edX
Tutor development
NODE_ENV=‘development’
PORT=18400
BASE_URL=‘http://local.overhang.io:18400’
LMS_BASE_URL=‘http://local.overhang.io:8000’
STUDIO_BASE_URL=‘http://studio.local.overhang.io:8000’
DISCOVERY_API_BASE_URL=‘http://discovery.local.overhang.io:8381’
LOGIN_URL=‘http://local.overhang.io:8000/login’
LOGOUT_URL=‘http://local.overhang.io:8000/logout’
CSRF_TOKEN_API_PATH=‘/csrf/api/v1/token’
REFRESH_ACCESS_TOKEN_ENDPOINT=‘http://local.overhang.io:8000/login_refresh’
ACCESS_TOKEN_COOKIE_NAME=‘edx-jwt-cookie-header-payload’
USER_INFO_COOKIE_NAME=‘edx-user-info’
SITE_NAME='edX
COURSE_CATALOG_API_URL=‘http://discovery:8381/api/v1’
Open edX production
NODE_ENV=‘production’
BASE_URL=null
LMS_BASE_URL=null
STUDIO_BASE_URL=null
DISCOVERY_API_BASE_URL=null
LOGIN_URL=null
LOGOUT_URL=null
CSRF_TOKEN_API_PATH=null
REFRESH_ACCESS_TOKEN_ENDPOINT=null
ACCESS_TOKEN_COOKIE_NAME=null
USER_INFO_COOKIE_NAME=null
SITE_NAME=null
NEW_RELIC_ADMIN_KEY=null
NEW_RELIC_APP_ID=null
NEW_RELIC_LICENSE_KEY=null
Tutor production
NODE_ENV=‘production’
PORT=18400
BASE_URL=‘http://mydomain.com:18400’
LMS_BASE_URL=‘http://mydomain.com’
STUDIO_BASE_URL=‘http://studio.mydomain.com’
DISCOVERY_API_BASE_URL=‘http://discovery.mydomain.com’
LOGIN_URL=‘MyDomain Login’
LOGOUT_URL=‘http://mydomain.com/logout’
CSRF_TOKEN_API_PATH=‘/csrf/api/v1/token’
REFRESH_ACCESS_TOKEN_ENDPOINT=‘http://mydomain.com/login_refresh’
ACCESS_TOKEN_COOKIE_NAME=‘edx-jwt-cookie-header-payload’
COURSE_CATALOG_API_URL=‘http://discovery:8000/api/v1’