找回密码
 立即注册
搜索
查看: 40|回复: 0

nginx配置

[复制链接]

52

主题

0

回帖

230

积分

管理员

积分
230
发表于 2025-8-21 22:25:53 | 显示全部楼层 |阅读模式
  1. /etc/nginx/sites-available/default

  2.         location / {
  3.                 proxy_pass http://127.0.0.1:5000;  # 转发到本地5000端口
  4.                 proxy_set_header Host $host;         # 传递原始Host头
  5.                 proxy_set_header X-Real-IP $remote_addr;  # 传递客户端真实IP
  6.                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  7.                 proxy_set_header X-Forwarded-Proto $scheme;  # 标记为HTTPS
  8.         }
复制代码

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

SKYPIEA

GMT+8, 2025-9-9 02:58 , Processed in 0.052112 second(s), 19 queries .

快速回复 返回顶部 返回列表