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 Web2Publish through the domain of the PubServer.
  • Example: pubserver.priintsuite.com/w2p/

Configure Apache Reverse Proxy​

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

Step 1: Locate Apache Configuration File​

Typical Apache installation paths on Windows:

  • C:\Apache24\conf\httpd.conf
  • OR (if using XAMPP): C:\xampp\apache\conf\httpd.conf

You can either:

  • Edit httpd.conf directly, or

  • Create a separate config file under:

    conf/extra/priintsuite.conf

    and include it in httpd.conf:

    Include conf/extra/priintsuite.conf

Step 2: Enable Required Modules​

Make sure these modules are enabled in httpd.conf (remove # if commented):

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule headers_module modules/mod_headers.so

Step 3: Identify Your Spring Boot App​

(Assuming your app runs on:)

http://127.0.0.1:8688

Add Reverse Proxy Configuration​

Add this to your config file:

RequestHeader set X-Forwarded-Proto "https"

ProxyPass /dm http://127.0.0.1:8688/w2p timeout=1200
ProxyPassReverse /dm http://127.0.0.1:8688/w2p timeout=1200

Step 5: Test Configuration​

Open Command Prompt (Run as Administrator):

cd C:\Apache24\bin
httpd.exe -t

Step 6: Restart Apache Service​

If installed as a Windows service:

httpd.exe -k restart

Or via Services:

  • Open Services (services.msc)
  • Restart Apache2.4

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: w2p-priintsuite.com

Configure Apache2 Reverse Proxy​

Step 1: Update Hosts File (for local testing)​

Edit:

C:\Windows\System32\drivers\etc\hosts

Add:

127.0.0.1 w2p-priintsuite.com

Step 2: Create Virtual Host Configuration​

Edit or add in httpd-vhosts.conf:

C:\Apache24\conf\extra\httpd-vhosts.conf

Make sure it's included in httpd.conf:

Include conf/extra/httpd-vhosts.conf

Step 3: Add VirtualHost Configuration​

<VirtualHost *:443>
ServerName w2p-priintsuite.com
ServerAdmin it-group@priint.com

ErrorLog "logs/error_proxy.log"
CustomLog "logs/access_proxy.log" combined

ProxyRequests Off

SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerName off
SSLProxyCheckPeerCN off
SSLProxyCheckPeerExpire off

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

SSLEngine on
SSLCertificateFile "conf/ssl/w2p-priintsuite.com.crt.pem"
SSLCertificateKeyFile "conf/ssl/w2p-priintsuite.com.key.pem"
SSLCertificateChainFile "conf/ssl/w2p-priintsuite.com.ca.pem"
</VirtualHost>

<VirtualHost *:80>
ServerName dm-priintsuite.com
Redirect permanent / https://w2p-priintsuite.com/
</VirtualHost>

Step 4: Enable SSL Module​

Ensure this is enabled in httpd.conf:

LoadModule ssl_module modules/mod_ssl.so

Also include SSL config:

Include conf/extra/httpd-ssl.conf

Step 5: Validate Configuration​

httpd.exe -t

Step 6: Restart Apache​

httpd.exe -t

Notes:

  • Ensure your SSL certificates are valid and correctly placed.
  • Windows firewall must allow ports:
    • 80 (HTTP)
    • 443 (HTTPS)
  • If using another reverse proxy (e.g., Nginx), adapt the configuration accordingly.
  • Always run:
httpd.exe -t

before restarting to verify configuration correctness.