ฉันจะแก้ไขข้อผิดพลาด net::ERR_SSL_PROTOCOL_ERROR ได้อย่างไรเมื่อฉันใส่ nginx ไว้หน้า Tomcat
#ผู้ใช้ไม่มีใคร;
ผู้ปฏิบัติงาน_กระบวนการ 1;
#error_log บันทึก/error.log;
#error_log บันทึก/การแจ้งเตือน error.log;
#error_log บันทึก/error.log ข้อมูล;
#pid บันทึก/nginx.pid;
เหตุการณ์ {
worker_connections 1024;
}
http {
รวม mime.types;
แอปพลิเคชัน default_type/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$สถานะ $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log บันทึก/access.log หลัก;
ส่งไฟล์บน;
#tcp_nopush บน;
#keepalive_timeout 0;
keepalive_timeout 65;
แมวตัวผู้ต้นน้ำ {
เซิร์ฟเวอร์ 127.0.0.1:8330;
}
ชุดอักขระ utf-8;
#gzip บน;
เซิร์ฟเวอร์ {
ฟัง 8331;
server_name localhost;
# ส่งคืน 301 https://$host$request_uri;
#charset koi8-r;
#access_log บันทึก/host.access.log หลัก;
ที่ตั้ง / {
# รูท html;
# ดัชนี index.html index.htm;
#proxy_pass http://sgmng.pluggolf.com;
proxy_set_header โฮสต์ $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-ส่งต่อ-สำหรับ $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy จริง;
proxy_http_version 1.1;
proxy_set_header อัพเกรด $http_upgrade;
proxy_set_header การเชื่อมต่อ "อัพเกรด";
proxy_set_header ต้นทาง "";
# ใหม่
# คัดลอกเส้นทางต้นน้ำที่ตั้งไว้ด้านบน
proxy_pass https://ทอมแคท;
# ปิด proxy_redirect;
ชุดอักขระ utf-8;
}
#error_page 404 /404.html;
# เปลี่ยนเส้นทางหน้าข้อผิดพลาดของเซิร์ฟเวอร์ไปยังหน้าสแตติก /50x.html
#
error_page 500 502 503 504 /50x.html;
ตำแหน่ง = /50x.html {
รูท html;
}
# พร็อกซี่สคริปต์ PHP เพื่อ Apache ฟัง 127.0.0.1:80
#
#location ~ \.php$ {
#proxy_pass http://127.0.0.1;
#}
# ส่งสคริปต์ PHP ไปยังเซิร์ฟเวอร์ FastCGI ที่รับฟัง 127.0.0.1:9000
#
#location ~ \.php$ {
# รูท html;
# fastcgi_pass 127.0.0.1:9000;
#fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# รวม fastcgi_params;
#}
# ปฏิเสธการเข้าถึงไฟล์ .htaccess หากรูทเอกสารของ Apache
# เห็นด้วยกับของ nginx
#
#location ~ /\.ht {
#ปฏิเสธทั้งหมด
#}
}
# โฮสต์เสมือนอื่นที่ใช้การกำหนดค่าตาม IP- ชื่อและพอร์ตผสมกัน
#
# เซิร์ฟเวอร์ {
# ฟัง 8080;
# ฟังชื่อ:8080;
# server_name somename นามแฝง another.alias;
# ที่ตั้ง / {
# รูท html;
# ดัชนี index.html index.htm;
# }
# }
#เซิร์ฟเวอร์ HTTPS
เซิร์ฟเวอร์ {
ฟัง 8332 ssl;
server_name localhost;
ชุดอักขระ utf-8;
ssl_certificate D:/service/cbdc_dt/nginx/cert/plusity.crt;
ssl_certificate_key D:/service/cbdc_dt/nginx/cert/plusity.key;
# ssl_session_cache ที่แชร์:SSL:1m;
#ssl_session_timeout 5 นาที;
ssl_ciphers สูง:!aNULL:!MD5;
เปิด ssl_prefer_server_ciphers;
ที่ตั้ง / {
# รูท html;
# ดัชนี index.html index.htm;
proxy_pass http://ทอมแคท;
proxy_set_header โฮสต์ $http_host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-ส่งต่อ-สำหรับ $proxy_add_x_forwarded_for;
# proxy_set_header X-ส่งต่อโปรโต $scheme;
# proxy_set_header X-NginX-Proxy จริง;
proxy_set_header อัพเกรด $http_upgrade;
การเชื่อมต่อ proxy_set_header '';
proxy_set_header ต้นทาง "";
proxy_http_version 1.1;
chunked_transfer_encoding ปิด;
ปิด proxy_buffering;
ปิด proxy_cache;
proxy_read_timeout 7d;
ปิด proxy_redirect;
ชุดอักขระ utf-8;
}
}
}
หลังจากใช้ ssl กับคำขอทั้งหมดที่มาถึงพอร์ต 8331 และ 8332 ดังต่อไปนี้ ฉันเขียนโค้ดที่เปลี่ยนเส้นทางไปยังพอร์ต 8330 ของ Tomcat
อย่างไรก็ตาม ปัญหาคือถ้าคุณไปที่ 8330 ผ่าน nginx แบบนี้ รับ https://serverIP:8330/itf/subscribe net::ERR_SSL_PROTOCOL_ERROR เกิดข้อผิดพลาด
/itf/subscribe ทำงานได้ตามปกติเมื่อไม่มี nginx
แต่ดูเหมือนว่าจะมีปัญหาเมื่อโทรจากภายในที่อยู่ของ https
ฉันสงสัยว่าฉันจะแก้ปัญหานั้นได้อย่างไร
ขอแสดงความนับถืออย่างสูง!