Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a port-share setup with OpenVPN and Apache over HTTPS which works nicely. However, in my Apache logs the requests are logged with the OpenVPN server IP, rather than the client's actual IP.

This makes any analysis of these logs useless, and I'd like to log the client's IP. How can I do that?

share|improve this question
add comment

1 Answer

It doesn't look like this will be possible - the only way you'd be able to do this is if OpenVPN were to intercept your HTTP requests at layer 7, and insert a header (something like X-Forwarded-For) with the client's IP in the request. Then you could use a custom log format, or something like mod_rpaf to ensure that IP ended up in the logs.

There's no mention of this feature in the OpenVPN docs, and I suspect they're just passing the TCP connection straight on once it's clearly not an HTTP request. Your best bet is probably to bring up a second IP address on your server and split the services like that.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.