Naccl / NBlog

🍓 Spring Boot + Vue 前后端分离博客系统 https://naccl.top
https://naccl.top
MIT License
2.38k stars 539 forks source link

大佬,我SSL配废了。 #138

Closed MrXnneHang closed 3 months ago

MrXnneHang commented 4 months ago
GET https://xnnehang.top:8090/site net::ERR_SSL_PROTOCOL_ERROR
createError.js:16 Uncaught (in promise) Error: Network Error
    at e.exports (createError.js:16:15)
    at g.onerror (xhr.js:117:14)
home.js:4 
GET https://xnnehang.top:8090/blogs net::ERR_SSL_PROTOCOL_ERROR

有点复杂。我宝塔面板拆了两个网站。 一个主域名,一个admin.不知道要不要配成一样的nginx api是用https:\主域名:port指向的,在axios.js和request.js还有application-dev.properties 都是那么写。 and 它在改成https(加了个s)之前都还是正常的。 但我前台和后台目前都无法访问后端。 前台8079,后台8080,api8090 前台的nginx配置:

# For xnnehang.top (Front-end)
server {
    listen 80;
    server_name xnnehang.top;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name xnnehang.top;

    ssl_certificate xnnehang.top.pem;
    ssl_certificate_key xnnehang.top.key;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";

    location / {
        proxy_pass http://127.0.0.1:8079; # Proxy to the front-end application
        proxy_set_header Host $host;
        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;
    }

    location /blog {
        proxy_pass http://127.0.0.1:8090; # Proxy to the API application
        proxy_set_header Host $host;
        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;
    }
}

# For admin.xnnehang.top (CMS)
server {
    listen 80;
    server_name admin.xnnehang.top;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name admin.xnnehang.top;

    ssl_certificate admin.xnnehang.top.pem;
    ssl_certificate_key admin.xnnehang.top.key;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";

    location / {
        proxy_pass http://127.0.0.1:8080; # Proxy to the CMS application
        proxy_set_header Host $host;
        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;
    }
}

呃有什么办法可以救一下,gpt救不了我。。

MrXnneHang commented 4 months ago

直接访问我的后端端口: 此网站无法提供安全连接xnnehang.top 发送的响应无效。 console中什么都没有 以前用http的时候后端似乎是有一个页面响应的。