nginx instructions comment

This commit is contained in:
Dan Ballard 2020-09-27 19:30:35 -07:00
parent ad6bf412b4
commit 649d6d3858
2 changed files with 7 additions and 0 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
Requires
proxy_set_header X-Real-IP $remote_addr;
in nginx server config

View File

@ -61,6 +61,9 @@ func listen(listenPort, proxyPort int) {
func filter(res http.ResponseWriter, req *http.Request, listenPort, proxyPort int) {
ip := req.RemoteAddr
// requires
// proxy_set_header X-Real-IP $remote_addr;
// in nginx server config
if realIp := req.Header.Get("X-Real-IP"); realIp != "" {
ip = realIp
}