代理不再识别真实IP

照旧,发帖并查看回复能帮我找到其他类似的帖子。:rofl: 例如:

谢谢大家!现在去配置容器内 nginx 的 set_real_ip_from

不过我会涵盖整个 RFC1918 地址空间。供其他人参考,配置如下:

after_bundle_exec:
  - replace:
    filename: /etc/nginx/conf.d/discourse.conf
    from: "types {"
    to: |
      set_real_ip_from 192.168.0.0/16;
      set_real_ip_from 172.16.0.0/12;
      set_real_ip_from 10.0.0.0/8;
      real_ip_recursive on;
      real_ip_header X-Forwarded-For;
      types {