【发布时间】:2021-11-18 00:39:29
【问题描述】:
我有一个烧瓶应用程序,它在端口 5000 上仅使用 uwsgi 作为服务运行良好。我正在尝试使用 Nginx 将 https 代理到后端的端口 5000。它正在访问我的应用程序,但是我的应用程序需要在标头上发送身份验证令牌,并且在通过 Nginx 代理时我没有得到它。但是,如果我将 URL 更改为端口 5000,则会传递标头。如何配置 Nginx 以将所有内容传递给应用程序?此应用执行 GET、PUSH、PUT、DELETE 操作,用户不仅会发送标头,还会发送 json 数据。
##################### NGINX CONFIG #####################
location /customer/ {
include uwsgi_params;
uwsgi_pass unix:///var/www/html/cisco/cisco.sock;
}
##################### UWSGI CONFIG #####################
[uwsgi]
module = wsgi:application
master = true
processes = 5
uid=apache
gid=apache
buffer-size = 32768
http = 0.0.0.0:5000
req-logger = file:/var/log/uwsgi/cart-req.log
logger = file:/var/log/uwsgi/cart-err.log
chmod-socket = 666
vacuum = true
socket = cisco.sock
die-on-term = false
py-autoreload = 1
【问题讨论】: