• NGINX反向代理去掉location

    发布于:2020-08-17 作者:Garany 评论(0) 引用(0) 浏览(1112)   分类:破万卷书  

    后端真实接口地址 http://127.0.0.1:8811/platform/region/allProvince 前端访问接口地址 http://xxx.abc.com/api/platform/region/allProvince 实际情况就是nginx在向后端请求接口的时候去掉api,即重写url location ~ /api/ {     rewrite ^/api/(.*)$ /$1 break;     proxy_pass http://127.0.0.1:8811;     proxy_read_timeout 150;     proxy_buffering off;     proxy_buffer_size 128k;     proxy_buffers 256 128k;     proxy_set_header X-Real-IP $remote_addr;     proxy_set_heade...

    阅读全文>>

  • nginx-status

    发布于:2019-07-15 作者:Garany 评论(0) 引用(0) 浏览(173)   分类:破万卷书  

    1.开启NGINX状态页stub_status # vim /etc/nginx/conf.d/default.conf server { listen *.80 default_server; server_name localhost _; location / { return 403; } location /nginx-status { stub_status on; access_log off; allow 127.0.0.1; deny all; } } 2.检测配置文件,重启NGINX # nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful # /etc/init.d/nginx rel...

    阅读全文>>

  • nginx反向代理报错 an upstream response is buffered to a temporary file

    发布于:2018-05-30 作者:Garany 评论(0) 引用(0) 浏览(333)   分类:破万卷书  

    调整nginx的error日志到warn级别,发现大量的warn错误 2018/05/30 11:51:40 [warn] 14416#0: *33213457 an upstream response is buffered to a temporary file /usr/local/nginx/proxy_temp/3/88/0002331883 while reading upstream, client: 123.138.233.236, server: www.xxxxx.com, request: "GET /html_app/img/dashi/touxiang/37.jpg HTTP/1.1", upstream: "http://127.0.0.1:65012/html_app/img/dashi/touxiang/37.jpg", host: "www.xxxxx.com", referrer: "http://www.xxxxx.com/html_app/dashi.html" 1.原因: nginx默认的buffer太小,请...

    阅读全文>>

    标签: linux nginx