一段简单完整的Nginx下部署SSL+支持PHP+WordPress伪静态的代码

  1. server {
  2. listen 443;
  3. root /home/wwwroot/blog_tag_gg/wwwroot;
  4. ssl on;
  5. ssl_certificate /home/ssl/blog.tag.gg.crt;
  6. ssl_certificate_key /home/ssl/blog.tag.gg.key;
  7. ssl_prefer_server_ciphers on;
  8. ssl_session_timeout 10m;
  9. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  10. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  11. server_name blog.tag.gg;
  12. index index.html index.php index.htm;
  13. location ~ \.php$ {
  14. fastcgi_pass 127.0.0.1:9000;
  15. fastcgi_index index.php;
  16. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  17. include fastcgi_params;
  18. }
  19.  
  20. location / {
  21. if (-f $request_filename/index.html){
  22. rewrite (.*) $1/index.html break;
  23. }
  24. if (-f $request_filename/index.php){
  25. rewrite (.*) $1/index.php;
  26. }
  27. if (!-f $request_filename){
  28. rewrite (.*) /index.php;
  29. }
  30. }
  31. }

记录在案,以后使用更方便.防止忘记

一段简单完整的Nginx下部署SSL+支持PHP+WordPress伪静态的代码

 

西数超哥学习乐园,西数超哥基础运维经验教程分享的学习乐园,西数超哥博客,运维经验教程交流学习分享的博客

原创文章,作者:zhang sir,如若转载,请注明出处:https://www.ysidc.top/7631.html