I have shellinabox running on a subdomain through HTTPS
and using HTTP Basic Access Authentication
using the vhosts file below:
<VirtualHost xx.xx.xx.xx:80>
ServerName host.bananas.net
Redirect 301 / https://host.bananas.net
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost.net>
<VirtualHost xx.xx.xx.xx:443>
ServerName host.bananas.net
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/bananas.net.crt
SSLCertificateKeyFile /etc/apache2/ssl/bananas.net.key
SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem
SSLCACertificateFile /etc/apache2/ssl/ca.pem
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
ProxyRequests Off
ProxyPass / http://localhost:4200/
ProxyPassReverse / http://localhost:4200/
<Location />
AuthUserFile /etc/apache2/.htpasswd-secure
AuthName "Go Away!"
AuthType Basic
Require valid-user
Order Deny,Allow
Allow from all
</Location>
SetEnvIf Request_URI "^/u" dontlog
HostnameLookups Double
CustomLog ${APACHE_LOG_DIR}/ssl_request.log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>
I currently have another site on another subdomain, using this vhosts file:
<VirtualHost xx.xx.xx.xx:80>
ServerName files.bananas.net
DocumentRoot /var/www/files.bananas.net/
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>
I would prefer to have the second site available at https://host.bananas.net/files
instead of http://files.bananas.net
.
The main reason for this is so that I can use the same SSL certificate, but there are other reasons as well.
How do I move the second site to be a subdirectory of the first site?
Exempt
/files
from the proxying:Put it above the root's
ProxyPass
. Looks like you'll also need to adjust yourDocumentRoot
s or file structure as needed to serve the content from the SSL vhost.An example configuration: