nginx 配置 springboot sse链接

 server {
        listen 443 ssl http2;  # 1.1版本后这样写
        server_name baidu.com; #填写绑定证书的域名
        ssl_certificate /www/server/nginx/ssl/baidu.pem;# 指定证书的位置,绝对路径
        ssl_certificate_key /www/server/nginx/ssl/baidu.key; # 绝对路径,同上
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置
        ssl_prefer_server_ciphers on;
        location / {
          proxy_pass http://127.0.0.1:8080/;   #转发到tomcat
          proxy_set_header Host $http_host;  ##proxy_set_header用来重定义发往后端服务器的请求头
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_buffering off;
          proxy_http_version  1.1;
          proxy_read_timeout 600s; ##设置SSE长链接保持时间为 600s
          }
    }

你可能感兴趣的:(nginx,ssl,https)