nginx 4层ssl:
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream --with-stream_ssl_preread_module --with-stream_ssl_module
node2:/root/nginx-1.17.9#/usr/local/nginx/sbin/nginx -c /etc/nginx/nginx_9000.conf
node2:/etc/nginx#cat /etc/nginx/nginx
cat: /etc/nginx/nginx: No such file or directory
node2:/etc/nginx#cat /etc/nginx/nginx_9000.conf
user nginx nginx;
worker_processes auto;
pid /var/run/nginx.pid;
worker_rlimit_nofile 51200;
events {
use epoll;
worker_connections 51200;
multi_accept on;
}
stream {
map $ssl_preread_server_name $name {
default test_9000;
}
log_format proxy '$remote_addr [$time_local]'
"$protocol|" "$status|" "$bytes_sent|" "$bytes_received|"
$session_time| "$upstream_addr|"
"$upstream_bytes_sent|" "$upstream_bytes_received|" "$upstream_connect_time|";
access_log /var/log/nginx/tcp-access.log proxy ;
error_log /var/log/nginx/tcp-error.log warn ;
server {
listen 8080;
proxy_pass $name;
proxy_connect_timeout 1s; #后端链接空闲超时断开
proxy_timeout 10s;#后端连接超时时间
}
upstream test_9000 {
server 192.168.137.3:9000 ;
}
}
django日志:
[31/May/2020 23:45:23] code 400, message Bad request version ('xhxe2xae=qxde?x185qxbdzVxe54}x90_xa4xffxd0xc8x90x02{.x8b~Dxe6xb0x00"x9ax9ax13x01x13x02x13x03xc0+xc0/xc0,xc00xccxa9xccxa8xc0x13xc0x14x00x9cx00x9dx00/x005x00')
[31/May/2020 23:45:23] code 400, message Bad HTTP/0.9 request type ('x16x03x01x02x00x01x00x01xfcx03x03?x063xe4xdcExfcx1eKSxdd&xde_xb7xa7x9b0xc5xb5)xc8xf2xdaxb1x04xc4"axf5h&')
[31/May/2020 23:45:23] You're accessing the development server over HTTPS, but it only supports HTTP.
[31/May/2020 23:45:23] You're accessing the development server over HTTPS, but it only supports HTTP.
[31/May/2020 23:45:23] code 400, message Bad HTTP/0.9 request type ('x16x03x01x02x00x01x00x01xfcx03x03Fxx13xd4xa2xb3x17x11lx9d*xda2xcfgxccx06xd6xfcx00,xc0bxd3Ixfdxe3z#x15xb1o')
[31/May/2020 23:45:23] You're accessing the development server over HTTPS, but it only supports HTTP.
[31/May/2020 23:45:23] code 400, message Bad HTTP/0.9 request type ('x16x03x01x00xb1x01x00x00xadx03x03xf9xa2x05xe2x07')
[31/May/2020 23:45:23] You're accessing the development server over HTTPS, but it only supports HTTP.