记一次Nginx 400错误
2016-05-31 21:51
399 查看
在一个非CDN的域名下有一个页面,需要请求CDN域名下的资源。所以在CDN的那台源站的Nginx上设置了
add_header 'Access-Control-Allow-Headers' 'X-Requested-With'
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS
add_header 'Access-Control-Allow-Origin' 'xx.com'
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS
add_header 'Access-Control-Allow-Origin' 'xx.com'
该页面同时也会请求一个.do接口,而这个接口部署在另外一个域名下,然后使用了 proxy_pass http://xx.com;
结果就悲剧了,报上面的400 bad request,request header or cookie too large,网上的解法是在
client_header_buffer_size 16k;
large_client_header_buffers 4 64k;
large_client_header_buffers 4 64k;
最后的处理方法是将proxy_pass IP:port;
具体原因暂时就没有深究了,暂时是这么处理的。
相关文章推荐
- Mac系统开发常见问题-80端口被占用的解决方案2-使用Nginx解决
- Linux 系列(六)——Nginx实现多虚拟主机配置
- 企业级nginx服务优化合集
- nginx 生成 缩略图 and 生成缩略图到硬盘
- Nginx Image Module图片缩略图 水印处理模块
- 配置 nginx location 实时查看 php-fpm 的状态
- Nginx 中 nginx.conf 详解
- Nginx 负载均衡 后端服务器获取前端用户真实IP
- CentOS 6.4 利用 Awstats 7.2 分析 Nginx 日志
- ubuntu14.04 下基于Nginx搭建mp4/flv流媒体服务器
- Nginx rewrite 规则 与 proxy_pass 实现
- 利用 gperftools 对nginx mysql 内存管理 性能优化
- Nginx负载均衡策略
- nginx keepalived 主从切换
- nginx安装
- Linux(CentOS6.x)下使用yum软件管理工具安装LNMP(Nginx+PHP+Mysql)环境并配置虚拟主机vhost
- nginx 安装
- centos6.7上使用nginx实现负载均衡!
- centos6.7上使用nginx实现负载均衡!
- 用GDB调试NGINX