How to use HTTP_X_FORWARDED_FOR properly?

前端 未结 6 1585
既然无缘
既然无缘 2020-12-05 17:01

Alright, I have an small authentication issue. My web service allows to connect to my API over HTTP with a username and password, but this connection can also be restricted

6条回答
  •  有刺的猬
    2020-12-05 17:48

    You can also solve this problem via Apache configuration using mod_remoteip, by adding the following to a conf.d file:

    RemoteIPHeader X-Forwarded-For
    RemoteIPInternalProxy 172.16.0.0/12
    LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    

提交回复
热议问题