错误问题

  1. The plain HTTP request was sent to HTTPS port

解决办法,fastcgi_param HTTPS $https if_not_empty 添加这条规则,

  1. server {
  2. listen 443 ssl; # 注意这条规则
  3. server_name my.domain.com;
  4. fastcgi_param HTTPS $https if_not_empty;
  5. fastcgi_param HTTPS on;
  6. ssl_certificate /etc/ssl/certs/your.pem;
  7. ssl_certificate_key /etc/ssl/private/your.key;
  8. location / {
  9. # Your config here...
  10. }
  11. }