Browse Source

Real-IP middleware for fastcgi + nginx doc update

pull/54/merge
andreimarcu 9 years ago
parent
commit
354278d488
  1. 2
      README.md
  2. 4
      server.go

2
README.md

@ -48,6 +48,8 @@ server {
client_max_body_size 4096M; client_max_body_size 4096M;
location / { 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; fastcgi_pass 127.0.0.1:8080;
include fastcgi_params; include fastcgi_params;
} }

4
server.go

@ -48,6 +48,10 @@ func setup() *web.Mux {
// middleware // middleware
mux.Use(middleware.RequestID) mux.Use(middleware.RequestID)
if Config.fastcgi {
mux.Use(middleware.RealIP)
}
if !Config.noLogs { if !Config.noLogs {
mux.Use(middleware.Logger) mux.Use(middleware.Logger)
} }

Loading…
Cancel
Save