-
-
Notifications
You must be signed in to change notification settings - Fork 226
Description
I'm using the nginx server as a reverse proxy for Qt TreeFrog as described on this page:
https://www.treefrogframework.org/en/user-guide/cooperation-with-the-reverse-proxy-server/
The problem is that in this case the TActionController::clientAddress()
and TWebSocketEndpoint::peerAddress()
functions return the proxy address instead of the client's IP address.
In nginx, you can add an X-Forwarded-For header containing the client's IP address:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
but unfortunately Qt TreeFrog does not have functionality similar to that of mod_remoteip Apache server:
https://httpd.apache.org/docs/current/es/mod/mod_remoteip.html
Would it be possible to add an option in the TreeFrog configuration to define the name of the HTTP header containing the client's original IP address (RemoteIPHeader) and the list of trusted proxy (RemoteIPTrustedProxy) ? The TActionController::clientAddress()
function would return the client's IP address instead of the proxy IP address if the proxy is trusted.
Thanks.