https下无法打开静态jsp页面

网站加了ssl证书后,发现所有静态jsp页面都无法打开,chrome报ERR_EMPTY_RESPONSE

图片描述

图片描述

nginx日志
图片描述
开始认为是内部调用http的事,
自己创建了个测试jsp页面,里面什么也没写,结果也打不开.再创建个HTML页面,可以打开.

nginx配置

server { 
    listen 80; 
    server_name xxxx.com www.xxxx.com; 
  
  location / { 
    proxy_pass http://127.0.0.1:18652; 
    proxy_redirect  off;  
    proxy_set_header Host $host; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    access_log /var/log/nginx/www.xxxx.com.log; 
  } 
} 
# PC
server {
    listen       443 ssl ;
    server_name www.xxxx.com xxxx.com;



   access_log /var/log/nginx/www.xxxx.com.log;

    ssl_certificate /etc/nginx/conf.d/xxxx_cert/ServerCertificate.cer;
    ssl_certificate_key /etc/nginx/conf.d/xxxx_cert/www.xxxx.com_key.txt;

    ssl_trusted_certificate /etc/nginx/conf.d/xxxx_cert_bak/CACertificate-INTERMEDIATE-1.cer;

    ssl_stapling off;


    add_header Strict-Transport-Security max-age=16588800 always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Frame-Options SAMEORIGIN always;
    add_header X-Content-Type-Options nosniff always;
    add_header Cache-Control no-cache always;

 include conf.d/safe/safe.conf;

      location / {
            proxy_pass  http://127.0.0.1:18652;
            proxy_redirect  off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           access_log /var/log/nginx/www.xxxx.com.log;
            }
}
阅读 2.5k
1 个回答
✓ 已被采纳新手上路,请多包涵

已解决 最终是nginx配置问题

修改后的nginx conf文件

server {
            listen 80;
            server_name xxxx.com www.xxxx.com;
            return 301 https://$host$request_uri;
                 
    }
# PC
server {
    listen       443 ssl ;
    server_name  www.xxxx.com xxxx.com;


     access_log /var/log/nginx/www.xxxx.com.log;

    ssl_certificate /etc/nginx/conf.d/xxxx_cert/ServerCertificate.cer;
    ssl_certificate_key /etc/nginx/conf.d/xxxx_cert/www.xxxx.com_key.txt;

    ssl_trusted_certificate /etc/nginx/conf.d/xxxx_cert_bak/CACertificate-INTERMEDIATE-1.cer;

    add_header Strict-Transport-Security "max-age=44236800; includeSubDomains; preload" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Frame-Options SAMEORIGIN always;
    add_header X-Content-Type-Options nosniff always;
    add_header Cache-Control no-cache always;
  

   location / {
            proxy_pass  http://127.0.0.1:18652;
            proxy_redirect  off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           access_log /var/log/nginx/www.xxxx.com.log;
            }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏