wordpress.tpl 2.5 KB

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