I am quite a newbie in the field of server configuration.
At work we want to setup a Maven repository with Apache Archiva, basically we want a place in which store the Maven projects we create.
I am able to run Archiva on localhost and to access it via http.
To be able to access to the repository via SSL, we wanted to configure Apache to act as a SSL proxy, I followed many guides (e.g. https://stackoverflow.com/questions/30871001/how-to-setup-apache-archiva-to-use-https-instead-of-http) on how to do that but the answer I get when I try to connect via https is
An error occurred during a connection to server_ip:8080. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG
My Virtual Host configuration looks like this:
Listen 8081
<VirtualHost *:8081>
ServerName server_ip
ProxyRequests Off
<Proxy http://localhost:8080>
Order allow,deny
Allow from all
</Proxy>
ProxyPreserveHost On
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /path_to_cert
SSLCertificateKeyFile /path_to_key
ProxyPass /http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
How can I solve the issue?
Best Answer
Other than the missing space in the line "ProxyPass /http://localhost:8080/" which I presume to be a copy/paste error (otherwise you server would not start), you only need "SSLProxyEngine On" when proxying to https, but you are pryxing to http, so you do not need this. Remove this directive and re-try, it should work.
Also you do not need the <Proxy http://localhost:8080 > block. These sorts of blocks are (almost) exclusively for configuring forward proxies, whereas you have a reverse proxy. They are very common across various 'guides' out on the internet, but they are not needed.