在 PROXY_PASS 之前修改请求正文

Sad*_*oja 6 lua reverse-proxy nginx

我有将所有请求传递给 nodejs 的 nginx 设置,但是我想在将它传递给 nodejs 之前修改 nginx 中的请求正文。就像 body 有http://www.example.com然后用https://www.example.com替换它

这是我的nginx配置:

location / {
    proxy_pass  http://127.0.0.1:8008;
    proxy_redirect off;
    proxy_set_header Host $host ;
    proxy_set_header X-Real-IP $remote_addr ;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
    proxy_set_header X-Forwarded-Proto https ;
}
Run Code Online (Sandbox Code Playgroud)