nginx 常用问题记录

反向代理

        location /qa_apis/ {
            proxy_pass http://127.0.0.1:9011/;
            proxy_set_header Host $host:$server_port;
        }

注意空格和tab,注意proxy_pass结尾的/

docker内的nginx,注意nginx的监听端口是容器内的,转发的ip尽量不用localhost和127.0.0.1

后续更新

正向代理

负载均衡

tcp端口转发

stream {
    server {
        ## ipv6监听80端口 listen [::1]:80;
        listen 88;
        proxy_pass 192.168.6.11:9200;
    }
}

vue路由问题

server
{
    listen 80;
    server_name testwx.wangshibo.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/ssoShuang/dist;
 
    #vue-router配置
    location / {
        try_files $uri $uri/ @router;
        index index.html;
    }
    location @router {
        rewrite ^.*$ /index.html last;
    }
}

大数据量问题

参数优化,上传413异常

client_max_body_size     50m; 
client_header_timeout    1m;
client_body_timeout      1m;
proxy_connect_timeout     60s;
proxy_read_timeout      1m;
proxy_send_timeout      1m;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值