Anamik Adhikary
Anamik Adhikary

Reputation: 451

Httpd.conf redirect to external url apache tomcat

I have an application that makes a call to an external URL. When I try to run it in localhost only some static HTML files which are in the localhost get loaded.

Any files located on the external URL doesn't load. It returns a 404 not found error.

I am using Apache sever, and Tomcat to run the application.

My Httpd.conf file has the following changes:

<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests On
ProxyVia On
ServerName localhost
ServerAlias *.localhost
ProxyPass /ab-ux-sass http://localhost:8080/ab-ux-sass
ProxyPassReverse /ab-ux-sass http://localhost:8080/ab-ux-sass
ProxyPass /ux-services https://boot.lender.com/ux-services
ProxyPassReverse /ux-services                    
                               https://boot.lender.com/ux-services
   </VirtualHost>

what config changes needs to be made?

Upvotes: 0

Views: 1109

Answers (1)

Anamik Adhikary
Anamik Adhikary

Reputation: 451

Made the following changes in the Httpd.conf file. It is working now.

 <VirtualHost *:80>
  ServerName dev.localhost
  SSLProxyEngine on
  ProxyRequests Off
  <Proxy *>
   Order allow,deny
   Allow from All
 </Proxy>
   ProxyPass /ab-ux-sass http://localhost:8080/ab-ux-sass
   ProxyPassReverse /ab-ux-sass http://localhost:8080/ab-ux-sass
   ProxyPass /ux-services https://boot.lender.com/ux-services
   ProxyPassReverse /ux-services                    
                           https://boot.lender.com/ux-services
 </VirtualHost>

Upvotes: 1

Related Questions