wordpress-http3.tpl 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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_port%;
  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. include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
  15. location = /favicon.ico {
  16. log_not_found off;
  17. access_log off;
  18. }
  19. location = /robots.txt {
  20. try_files $uri $uri/ /index.php?$args;
  21. log_not_found off;
  22. access_log off;
  23. }
  24. location ~ /\.(?!well-known\/) {
  25. deny all;
  26. return 404;
  27. }
  28. location / {
  29. try_files $uri $uri/ /index.php?$args;
  30. 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)$ {
  31. expires 30d;
  32. fastcgi_hide_header "Set-Cookie";
  33. }
  34. location ~* /(?:uploads|files)/.*.php$ {
  35. deny all;
  36. return 404;
  37. }
  38. location ~ [^/]\.php(/|$) {
  39. try_files $uri =404;
  40. include /etc/nginx/fastcgi_params;
  41. fastcgi_index index.php;
  42. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  43. fastcgi_param HTTP_HOST $host;
  44. fastcgi_pass %backend_lsnr%;
  45. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
  46. if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
  47. set $no_cache 1;
  48. }
  49. 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") {
  50. set $no_cache 1;
  51. }
  52. }
  53. }
  54. location /error/ {
  55. alias %home%/%user%/web/%domain%/document_errors/;
  56. }
  57. location /vstats/ {
  58. alias %home%/%user%/web/%domain%/stats/;
  59. include %home%/%user%/web/%domain%/stats/auth.conf*;
  60. }
  61. include /etc/nginx/conf.d/phpmyadmin.inc*;
  62. include /etc/nginx/conf.d/phppgadmin.inc*;
  63. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  64. }