Re: redirecting web requests from localhost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxx>
Sender: centos-bounces@xxxxxxxxxx
Date: Wed, 28 Aug 2013 21:49:31 
To: <centos@xxxxxxxxxx>
Reply-To: CentOS mailing list <centos@xxxxxxxxxx>
Subject:  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@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos





[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux