savokiss.com.conf
server { listen 443 ssl http2 reuseport; server_name savokiss.com www.savokiss.com; root /var/www/html/savokiss.com; index index.php; include /etc/nginx/conf.d/ssl.config; access_log /var/log/nginx/typecho_access.log main; if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } location ~ .*.php(/.*)*$ { include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; fastcgi_pass phpfpm:9000; } } server { listen 80; server_name savokiss.com www.savokiss.com; rewrite ^(.*) https://savokiss.com$1 permanent; }
上面的 phpfpm 是在 docker run 时指定的 link 到该 container 内部的名称
ssl.config
ssl_certificate /etc/nginx/conf.d/cert/perm.pem; ssl_certificate_key /etc/nginx/conf.d/cert/perm.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on;