wordpress.stpl 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #=======================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. #=======================================================================#
  5. server {
  6. listen %ip%:%web_ssl_port% ssl http2;
  7. server_name %domain_idn% %alias_idn%;
  8. root %docroot%;
  9. index index.php index.html index.htm;
  10. access_log /var/log/nginx/domains/%domain%.log combined;
  11. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  12. error_log /var/log/nginx/domains/%domain%.error.log error;
  13. ssl_certificate %ssl_pem%;
  14. ssl_certificate_key %ssl_key%;
  15. ssl_stapling on;
  16. ssl_stapling_verify on;
  17. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  18. location = /favicon.ico {
  19. log_not_found off;
  20. access_log off;
  21. }
  22. location = /robots.txt {
  23. allow all;
  24. log_not_found off;
  25. access_log off;
  26. }
  27. location ~ /\.(?!well-known\/) {
  28. deny all;
  29. return 404;
  30. }
  31. location ~* /(?:uploads|files)/.*.php$ {
  32. deny all;
  33. return 404;
  34. }
  35. location / {
  36. try_files $uri $uri/ /index.php?$args;
  37. location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
  38. expires 30d;
  39. fastcgi_hide_header "Set-Cookie";
  40. }
  41. location ~ [^/]\.php(/|$) {
  42. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  43. try_files $uri =404;
  44. fastcgi_pass %backend_lsnr%;
  45. fastcgi_index index.php;
  46. include /etc/nginx/fastcgi_params;
  47. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  48. if ($request_uri ~* "/wp-admin/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
  49. set $no_cache 1;
  50. }
  51. if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {
  52. set $no_cache 1;
  53. }
  54. }
  55. }
  56. location /error/ {
  57. alias %home%/%user%/web/%domain%/document_errors/;
  58. }
  59. location /vstats/ {
  60. alias %home%/%user%/web/%domain%/stats/;
  61. include %home%/%user%/web/%domain%/stats/auth.conf*;
  62. }
  63. include /etc/nginx/conf.d/phpmyadmin.inc*;
  64. include /etc/nginx/conf.d/phppgadmin.inc*;
  65. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  66. }