Digital Ocean, Node.js, Nginx and Cloudflare (400 badrequest No required SSL certificate was sent)

橙三吉。 提交于 2020-04-16 05:47:08

问题


I am getting a 400 Bad Request error. Sometimes it works, sometimes it doesn't. On the phone it seems to work more often than not. I am not sure what the deal is but it is quite irritating.

server {
  listen 80;
  listen [::]:80;
  server_name url url;
  return 301 https://$host$request_uri;
}

server {

    # SSL configuration

    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name url  url;

    ssl        on;
    ssl_certificate         /etc/ssl/certs/cert.pem;
    ssl_certificate_key     /etc/ssl/private/key.pem;
    ssl_client_certificate /etc/ssl/certs/cloudflare.crt;
    ssl_verify_client on;


    location / {
           proxy_pass    http://localhost:8080;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
    }
}

回答1:


I also experienced this in one the new websites in my server that uses CloudFlare. The issue was that SSL/TLS > Origin Server > Authenticated Origin Pulls was not activated by default in the new website that shares server with my other sites which already had Authenticated Origin Pulls activated. So I just had to activate that for the new site. In other peoples' cases, that may be checked if there is a need to deactivate it.



来源:https://stackoverflow.com/questions/55606390/digital-ocean-node-js-nginx-and-cloudflare-400-badrequest-no-required-ssl-cer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!