We're attempting to identify where specific requests are coming from inside our Java application. We have changed the log files to include the IP address and we're using httpServletRequest.getRemoteAddr()
to get that remote address.
When using xinetd to forward external requests on port 443 to an internal port our application server is listening on (e.g. 8999), getRemoteAddr()
always returns 127.0.0.1. If we remove xinetd from the stack, we get the correct address.
Note that the X-Forwarded-For
header does not get populated either.
Is there any way to continue to use xinetd to port forward without it stripping out the requestor's IP address?
Our setup:
service https
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
port = 443
protocol = tcp
redirect = localhost 8999
log_on_failure += USERID
}