反向代理
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;