如何使用允许SSL的nginx设置CodeIgniter?

我的nginx.conf文件有:

 server { listen 80; listen 443; server_name www.mysite.com; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; root /var/www/mysite/current; index index.html index.php; location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { expires max; log_not_found off; } location / { try_files $uri $uri/ /index.php; } location ~* \.php$ { fastcgi_pass 127.0.0.1:9000; include fastcgi.conf; } } 

这工作,除了不会在端口443做SSL。任何想法,为什么不呢?

您还没有设置ssl_certificatessl_certificate_key ,我相信这是实际使用SSL所必需的。 如果您没有CA证书,则可以使用自签名证书。