欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

​Nginx转发添加请求头信息

Nginx转发添加请求头信息

 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jeccisnd/article/details/87888979

server {
        listen      80;
        server_name  localhost;
        location ^~ /demo {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header userid '123456789';
            proxy_set_header X-Nginx-Proxy true;
            proxy_pass http://10.10.10.25:443;
            }

    }

使用这种方法添加头部信息,并转发下一阶段的传递者

proxy_set_header userid '123456789';

 

来自 https://blog.csdn.net/jeccisnd/article/details/87888979

普通分类: