This is out of date. See How To Add an MFE to a Sandbox for more current information |
This how-to describes how to serve your frontend app using nginx on an edX sandbox with a second edX sandbox as it's backend.
First, we want to deploy an edX sandbox which will be used to serve your frontend app using the sandbox provisioning job at https://tools-edx-jenkins.edx.org/job/Sandboxes/job/CreateSandbox/build?delay=0sec.
Second, we want to deploy an edX sandbox which will be used as our backend using the sandbox provisioning job at https://tools-edx-jenkins.edx.org/job/Sandboxes/job/CreateSandbox/build?delay=0sec. Be sure to include all of the services you will need for your frontend app (i.e. LMS, Studio, ecommerce, etc.).
We will use the first sandbox to serve your built frontend app using the nginx instance provisioned on the sandbox.
Replace:
location / { try_files $uri @proxy_to_lms_app; } |
With:
location / { root [path to your frontend app's dist directory]; try_files /$file =404; } |
You will need to edit the settings of your backend services on the backend sandbox to allow cross domain requests to be made to them.