直接入正题
在网上找了很多nginx+tomcat+ssl的文章
但是配置下来,都是http访问ok
https访问一直都是400 错误,
配置如下:
nginx.conf:
#定义Nginx运行的用户和用户组
#user nobody;
#nginx进程数,建议设置为等于CPU总核心数。
worker_processes 1;
events {
worker_connections 1024;
}
http {
#文件扩展名与文件类型映射表
include mime.types;
#默认文件类型
default_type application/octet-stream;
client_max_body_size 8m;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 120;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
gzip on;
upstream test_client_https.com{
server 192.168.2.120:9444;
}
upstream test_client_http.com{
server 192.168.2.120:9081;
}
map $scheme $fastcgi_https {
default off;
https on;
}
server {
listen 9080;
#域名可以有多个,用空格隔开
server_name localhost clientAuth Catalina;
charset utf-8;
location ~ ^/NginxStatus{
stub_status on;
}
location / {
proxy_pass http://test_client_http.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header SSL_CERT $ssl_client_cert;