Apache setup to remove/add application context

I have configured the Apache to respond multiple applications deployed on the same tomcat server. All web application have different application context. I want to hide application context from end user as I have different subdomain for both application


<VirtualHost *:443>

    ServerName iot.project.in
    ServerAlias www.iot.project.in
  ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    #Configure SLL certificate
    SSLEngine on
    SSLCertificateFile /ssl/wildcard_ssl/IoT.crt
    SSLCertificateKeyFile /ssl/wildcard_ssl/IOT.key

    #rewrite application context URL shown in browser so user will      #always redirect to new URL (if not POST method)
    RewriteEngine  on
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteRule ^(\/iot)(.*)$ $2 [NE,R]
    # Here [R] will redirect URL and [NE] noescape  is to prevent URL      # encoding agian


    ProxyPreserveHost off
    ProxyPass /iot/ http://my.applicaiton.ip:8000/iot/
    ProxyPass / http://my.applicaiton.ip:8000/iot/
    ProxyPassReverse / http://my.applicaiton.ip:8000/iot/
    ProxyPassReverseCookiePath /iot /

</VirtualHost>


Comments

Popular posts from this blog

Git Auto Increment tag

Log rotate (catalina.out) of Tomcat

Bypass SSL certificate check for Apache Axis2 client