Sorry if this question is really basic. I have a server for which it’s inconvenient for me to configure the DNS records. However I need to host several phoenix apps on it. Therefore I’d like to do it in such a way: www.myserver.com/appA
, www.myserver.com/appB
.
I am able to configure Nginx/HAProxy to proxy traffic to those URLs to different ports of the server, and use the URL rewrite rule to strip the /appA
part. Apparently the base URL of the app needs to have /appA
appended, otherwise the requests for static assets will not be rewritten correctly (i.e. the links need to be www.myserver.com/appA/js/app-hash.js
instead of just www.myserver.com/js/app-hash.js
)
The :path
option under :url
in Phoeix.Endpoint is supposed to help with this scenario. However, changing it to /appA
seems to have no effect. The links to the static assets still seem to be www.myserver.com/js/app-hash.js
?
I’m not sure what I’m doing wrong here. After changing the option, I ran through the following:
$ mix deps.get --only prod
$ MIX_ENV=prod mix compile
$ brunch build --production
$ mix phx.digest
so I thought the links should have been updated.