Using subdirectory paths to serve multiple apps under the same (sub)domain
NOTE:
This example will serve openspeedtest app under
https://apps.example.com/speedtest
And strip the/speedtest
prefix before sending the request backend app
speedtest-stripprefix
/speedtest
apps.example.com
Path *
/speedtest
Path Type *
prefix
Because the openspeedtest app has no idea that it is being served from https://apps.example.com/speedtest
instead of https://apps.example.com/
,
we will need to add some additional paths in order for it to work properly.
Pro Tip:
You can find asset paths by first deploying the app without adding any, then opening it in the browser looking at the 404 Errors in the browser console.
WARNING:
You may have conficts if more than one app uses the same paths! I don’t have a solution for this (yet).
Path *
/assets
Path Type *
prefix
Path *
/upload
Path Type *
prefix
Path *
/download
Path Type *
prefix
apps.example.com
example_com_cert ˅
speedtest-stripprefix
librespeed example
NOTE:
This example will serve librespeed app under
https://apps.example.com/librespeed
And strip the/librespeed
prefix before sending the request backend app
librespeed-stripprefix
/librespeed
apps.example.com
Path *
/librespeed
Path Type *
prefix
Because the librespeed app has no idea that it is being served from https://apps.example.com/speedtest
instead of https://apps.example.com/
,
we will need to add some additional paths in order for it to work properly.
Pro Tip:
If you know a bit of code, you can try searching the app’s repo for all the paths it uses.
Path *
/results/
Path Type *
prefix
Path *
/backend/
Path Type *
prefix
Path *
/speedtest_worker.js
Path Type *
prefix
Path *
/speedtest.js
Path Type *
prefix
apps.example.com
example_com_cert ˅
librespeed-stripprefix