I haven't been able to find a solution to this exact problem:
- I have one app running on localhost:3000
- I have a proxy set up for my localhost:3000 app with qa.mysite.com (for other js)
- I added a second app running on localhost:3333
The first app needs to reference some localhost:3333 css and js files:
<link rel="stylesheet" href="/css/my-css.css"/>
<script src="/js/my-js.js" defer></script>
I tried this conf (and variations):
<VirtualHost *:443>
ServerName qa.mysite.com
SSLEngine on
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLCertificateFile "/etc/apache2/server.crt"
SSLCertificateKeyFile "/etc/apache2/server.key"
ProxyVia Full
ProxyPreserveHost On
ProxyPass "/" "http://localhost:3000/"
ProxyPassReverse "/" "http://localhost:3000/"
ProxyPass "/css/my-css.css" "http://localhost:3333/css/my-css.css"
ProxyPassReverse "/css/my-css.css" "http://localhost:3333/css/my-css.css"
ProxyPass "/js/my-js.js" "http://localhost:3333/js/my-js.js"
ProxyPassReverse "/js/my-js.js" "http://localhost:3333/js/my-js.js"
</VirtualHost>
- Hitting qa.mysite.com yields the first app running at localhost:3000.
- But also CORS errors or refused connections.
Any idea what I'm doing wrong? :)