[CentOS] redirecting web requests from localhost

diegors at gmail.com diegors at gmail.com
Wed Aug 28 21:16:53 UTC 2013


Could be hardcoded in your java app, by hostname or ip?

Just open your java (its a zip renamed) and see file contents (some of files inside, are text plain). 

Also, you can find a debuger

Diego Sanchez

Sent from my mobile

-----Original Message-----
From: Miguel González <miguel_3_gonzalez at yahoo.es>
Sender: centos-bounces at centos.org
Date: Wed, 28 Aug 2013 21:49:31 
To: <centos at centos.org>
Reply-To: CentOS mailing list <centos at centos.org>
Subject: [CentOS] redirecting web requests from localhost

Dear all,

    I´m testing a server and try to simulate a server in production. We 
have a SSL certificate and I have configured the test server with the 
same servername as it is in production. To access it, I change the hosts 
file in my laptop to reach the test server.

    However, the Java application running in the server tries to access 
some local web content. I have changed the hosts file and some 
applications (ping, wget) they get the local IP address. However 
nslookup and maybe our Java application (I didn´t have the programmer 
available to debug it) are getting the production server IP.

    So, how can I redirect for instance 443 traffic to a specific IP to 
the local IP address of the local server? I have tried this:

     iptables -t nat -A PREROUTING -d XXX.XXX.XXX.XXX -p tcp --dport 80 
-j DNAT --to YYY.YYY.YYY.YYY

   XXX.XXX.XXX.XXX - IP of production server

   YYY.YYY.YYY.YYY - local IP of the test server

   Thanks

   Miguel




This message and any attachments are intended for the use of the addressee or addressees only. The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its content is not permitted. If you received this message in error, please notify the sender and delete it from your system. Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.

_______________________________________________
CentOS mailing list
CentOS at centos.org
http://lists.centos.org/mailman/listinfo/centos


More information about the CentOS mailing list