Procedure
- Stop your Tomcat server.
- Set the configuration. The configuration file is <TomcatPath>/bin/setenv.sh. If the file does not exist, create it.
-
Add the following parameters, changing the parameters to match with your
configuration:
CATALINA_OPTS=$CATALINA_OPTS -Dhttp.proxyHost=proxy.server.com # Specify the host name or IP address of your HTTP proxy server. You can use this parameter for http and https host names. CATALINA_OPTS=$CATALINA_OPTS -Dhttp.proxyPort=YourHttpProxyPort # Specify the port number of your proxy server. CATALINA_OPTS=$CATALINA_OPTS -Dhttp.nonProxyHosts="localhost|host.mydomain.com|192.168.0.1" # Specify a list of hosts separated by "|" that do not require access through your proxy server.
For example:CATALINA_OPTS=$CATALINA_OPTS -Dhttp.proxyHost=proxy.server.com CATALINA_OPTS=$CATALINA_OPTS -Dhttp.proxyPort=3128 CATALINA_OPTS=$CATALINA_OPTS -Dhttp.nonProxyHosts="localhost|host.mydomain.com|192.168.0.1"
In case you use a proxy with authentication, go to<tomcat_path>/WEB-INF/classes/configuration.properties
file and uncomment the following lines:- proxy with the HTTP protocol:
#http.proxyUser=someuser #http.proxyPassword=somepassword
- proxy with the HTTPS protocol:
#https.proxyUser=someuser #https.proxyPassword=somepassword
- proxy with the HTTP protocol:
- Restart your Tomcat server.