I'm struggeling for days now to route a subdomain with SSL to a local running vue app, specifically the directus admin ui.
I've done this before, like with the tool monit, and it worked like a charm:
<VirtualHost *:80>
ServerName monit.mydomain.com
Redirect permanent / https://monit.mydomain.com
</VirtualHost>
<VirtualHost *:443>
ServerName monit.mydomain.com
ProxyPass / http://localhost:2828/
Include /etc/apache2/include.conf <-- holds the key & certificate infos
</VirtualHost>
But with the directus admin ui, which is running on localhost:3000, this doesn't work, and apache gives me no error output at all, but shows some access logs, for example:
<IP> - - [14/Apr/2021:00:10:36 +0200] "GET /admin/js/chunk-vendors.8f8dd28c.js HTTP/1.1" 404 418 "https://admin.mydomain.com/app1/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36 Edg/89.0.774.75"
The Browser simply shows:
GET https://admin.mydomain.com/admin/js/app.0038e4e5.js net::ERR_ABORTED 404 (Not Found)
The VirtualHost config I use is:
<VirtualHost *:80>
ServerName admin.mydomain.com
Redirect Permanent / https://admin.mydomain.com
</VirtualHost>
<VirtualHost *:443>
ServerName admin.mydomain.com
Include /etc/apache2/include.conf
RewriteEngine on
RewriteRule ^/app1/(.*)$ http://localhost:3000/admin/$1 [proxy,last]
ProxyPassReverse /app1http://127.0.0.1:3000/
</VirtualHost>
The reason for /app1
is that later I want to route admin uis for several apps, each running on a different port, like /app1 -> http://localhost:3000, /app2 -> http://localhost:3100
Hope someone could give me a hint to solve this, thanks in advance!