在server中加上红色所示一行:server { listen 443; ... more config here, include SSL ... location ~ \.php$ { ... FastCGI config here ... fastcgi_param HTTPS on; } }