Skip to main content

Configuring Reverse Proxy

There are two solutions if you want to configure a reverse proxy for your application:

Solution 1: Use Default Domain of Pub-server

  • In this case, you can access Data Management through the domain of the PubServer.
  • Example: pubserver.priintsuite.com/dm/

Configure Apache2 Reverse Proxy

Note: If using another reverse proxy (e.g., Nginx), the process will be similar.

Step 1: Edit the configuration file (run with sudo permissions)

sudo nano /etc/apache2/sites-available/priintsuite.conf

Step 2: Identify your Spring Boot application's IP and port

(Assuming the Data Management application runs on localhost:8686)

Step 3: Add the following configuration lines

    RequestHeader set X-Forwarded-Proto "https"

ProxyPass /dm http://127.0.0.1:8686/dm timeout=1200
ProxyPassReverse /dm http://127.0.0.1:8686/dm timeout=1200

Step 4: Check Apache configuration syntax

apachectl configtest

Step 5: Reload/Restart Apache

sudo systemctl restart apache2

Solution 2: Create and Use a New Custom Domain

  • If you want to use a different domain instead of the Pub Server domain follow these steps.
  • Example: dm-priintsuite.com

Configure Apache2 Reverse Proxy

Step 1: Create a New Domain Configuration File

Add configuration file /etc/apache2/sites-available/data-management.conf and add the following content:

    <VirtualHost *:443>
ServerName dm-priintsuite.com
ServerAdmin it-group@priint.com
ErrorLog ${APACHE_LOG_DIR}/error_proxy.log
CustomLog ${APACHE_LOG_DIR}/access_proxy.log combined

ProxyRequests Off

SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerName off
SSLProxyCheckPeerCN off
SSLProxyCheckPeerExpire off
SSLProxyProtocol +TLSv1.2 +TLSv1.3

ProxyPass / http://127.0.0.1:8686/ timeout=1200
ProxyPassReverse / http://127.0.0.1:8686/ timeout=1200


SSLEngine on
SSLCertificateFile /etc/ssl/certs/priintsuite.com.crt.pem
SSLCertificateKeyFile /etc/ssl/private/priintsuite.com.key.pem
SSLCertificateChainFile /etc/ssl/certs/priintsuite.com.ca.pem

</Virtualhost>

<VirtualHost *:80>

ServerName dm-priintsuite.com
Redirect permanent / https://dm-priintsuite.com

</VirtualHost>

Step 2: Enable the New Virtual Host and Restart Apache

   sudo a2ensite data-management.conf
sudo systemctl restart apache2

Notes:

  • Ensure the SSL certificates are properly configured.
  • If using a different reverse proxy, adjust the configuration accordingly.
  • Run sudo apachectl configtest before restarting Apache to verify configuration correctness.