diff --git a/README.md b/README.md index 924480c..ebdc9a8 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ server { client_max_body_size 4096M; location / { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; fastcgi_pass 127.0.0.1:8080; include fastcgi_params; } diff --git a/server.go b/server.go index caa93a2..252babd 100644 --- a/server.go +++ b/server.go @@ -48,6 +48,10 @@ func setup() *web.Mux { // middleware mux.Use(middleware.RequestID) + if Config.fastcgi { + mux.Use(middleware.RealIP) + } + if !Config.noLogs { mux.Use(middleware.Logger) }