📜  ngingx proxy express 获取真实IP - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:48.331000             🧑  作者: Mango

代码示例1
1) app.set('trust proxy', true) in your Express app.
2) Add proxy_set_header X-Forwarded-For $remote_addr in
  the Nginx configuration for your server block.
// sudo nano /etc/nginx/sites-available/default