wordpress.stpl 2.8 KB

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