• NGINX反向代理去掉location

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

    后端真实接口地址 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...

    阅读全文>>