How can I set up a reverse proxy for the user portal (and Bright View in 8.x) from 7.1 onward?
In this KB article we describe the steps needed to configure the Apache httpd web server as a reverse proxy in front of the user portal that CMDaemon serves.
With this setup it is possible to assign a certificate signed by a public certification authority. Also, port 443 can be exposed instead of the default port 8081.
The first step is to create the configuration files userportal.conf and bright-view.conf for the reverse proxy.
For Apache httpd version 2.4, the following file format can be used:
# cat > /etc/httpd/conf.d/userportal.conf << _EOF_ ProxyPass /json https://127.0.0.1:8081/json
# cat > /etc/httpd/conf.d/bright-view.conf << _EOF_ ProxyPass /bright-view/ https://127.0.0.1:8081/bright-view/ ProxyPassReverse /bright-view/ https://127.0.0.1:8081/bright-view/ |
For Apache httpd 2.2 the following file configurations can be used:
# cat > /etc/httpd/conf.d/userportal.conf << _EOF_ ProxyPass /bright-view/ https://127.0.0.1:8081/bright-view/
# cat > /etc/httpd/conf.d/bright-view.conf << _EOF_ ProxyPass /bright-view/ https://127.0.0.1:8081/bright-view/ ProxyPassReverse /bright-view/ https://127.0.0.1:8081/bright-view/ |
The second step is to include the change on the Bright Cluster web landing page (index.php). This will make it use the correct link (that is, strip out the :8081 for the user portal and bright-view) when constructing the URL for them:
# sed -i 's_:8081/userportal_/userportal_g' /var/www/html/index.php
# sed -i 's_:8081/bright-view_/bright-view_g' /var/www/html/index.php |
Now it is possible to access the user portal using the standard HTTPS port 443.
To figure out where you store your new certificate files on your head node, take a look at /etc/httpd/conf.d/ssl.conf on your head node, specifically the following directives:
SSLCertificateFile
SSLCertificateKeyFile
SSLCertificateChainFile
Then, change those directives to point to the new certificates and key.
With these configurations in place, reload the Apache httpd webserver:
# service httpd reload |