Am 27.02.2015 um 20:17 schrieb Luís Marques:

Apparently, when you set a vibe.d server behind a reverse proxy, the log file will indicate the IP address of the reverse proxy, not the original request, even if you have the reverse proxy setting X-Forwarded-Host, Host, X-Forwarded-For and X-Real-IP.

What do you do in these circumstances? Do you have the reverse proxy do the logging, and disable the log in the vibe.d instance? Or do you tweak the logger to use the IP address from the correct header setting?

In any case, where do you prefer to have the logging happening? Why? I can see pros and cons for either place.

You could change the default HTTPServerSettings.accessLogFormat to use
%{X-Forwarded-Host}i instead of %h.

I usually log at the reverse proxy, because I like to have direct and
sequential access to all requests when debugging or analyzing things. I
can also see arguments for logging at the individual server processes,
but that would mostly be for performance reasons and I currently simply
don't have a high enough load for having to worry about that.