vhost配置文件的作用 作用:vhost配置文件的作用是为了将多个server配置文件的信息,单独存放,不过于集中在nginx.conf配置中,这样有用助于故障排除,如配置查看 通过访问服务端nginx代理的域名可将流量转发至配置的客户机,客户机将服务端转发过来的流量转发至本机的监听相应端口的服务。 nginx代理服务端: #网易云音乐API虚拟主机块配置 server{ listen 80; server_name music163.cjzshilong.cn; location / { proxy_pass http://127.0.0.1; } } # HTTPS server server { listen 443 ssl; server_name music163.cjzshilong.cn; ssl_certificate /usr/local/nginx/conf/ssl/1_163.cjzshilong.cn_bundle.crt; ssl_certificate_key /usr/local/nginx/conf/ssl/2_163.cjz.... Nginx的Vhost配置 Linux
近来几天发现访问博客端文章间歇性报出502,一开始以为是solo博客端的配置问题,纠正排查后发现不是博客后台设置的问题。后来查看nginx的日志。发现如下报错: 2019/10/20 20:05:09 [error] 8539#0: *67 no live upstreams while connecting to upstream, client: 111.194.50.93, server: cjzshilong.cn, request: "GET /sw.js HTTP/1.1", upstream: "http://localhost/sw.js", host: "www.cjzshilong.cn", referrer: "www.cjzshilong.cn/sw.js" 2019/10/20 20:08:53 [notice] 8638#0: signal process started 2019/10/20 20:09:11 [error] 8659#0: *2 upstream sent too big header while reading resp.... 修复nginx报错:"upstream sent too big header while reading response header from upstream" Linux
nginx 配置 upstream backend { server localhost:8080; # Solo Docker 监听端口 } server { listen 80; server_name cjzshilong.cn www.cjzshilong.cn; # 博客域名 rewrite ^(.*) https://host$1 permanent; location / { proxy_pass http://backendrequest_uri; proxy_set_header Host host:server_port; proxy_set_header Connection "Keep-Alive"; proxy_set_header X-Real-IP remote_addr; client_max_body_size 10m; proxy_buffer_size 128k; proxy_buffers 32 32k; proxy_busy_buffers_size 128k; } nginx反向代理tomcat项目之solo nginx