modx.stpl 2.2 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_ssl_port% ssl http2;
  7. server_name %domain_idn% %alias_idn%;
  8. root %sdocroot%;
  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. # if you need to rewrite www to non-www uncomment bellow
  19. # if ($host != '%domain%' ) {
  20. # rewrite ^/(.*)$ https://%domain%/$1 permanent;
  21. # }
  22. location = /favicon.ico {
  23. log_not_found off;
  24. access_log off;
  25. }
  26. location = /robots.txt {
  27. allow all;
  28. log_not_found off;
  29. access_log off;
  30. }
  31. location / {
  32. try_files $uri $uri/ @rewrite;
  33. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  34. expires max;
  35. fastcgi_hide_header "Set-Cookie";
  36. }
  37. }
  38. location @rewrite {
  39. rewrite ^/(.*)$ /index.php?q=$1;
  40. }
  41. location ~ \.php$ {
  42. try_files $uri =404;
  43. fastcgi_pass %backend_lsnr%;
  44. fastcgi_index index.php;
  45. fastcgi_param SCRIPT_FILENAME $request_filename;
  46. include /etc/nginx/fastcgi_params;
  47. }
  48. location /error/ {
  49. alias %home%/%user%/web/%domain%/document_errors/;
  50. }
  51. location ~* "/\.(htaccess|htpasswd)$" {
  52. deny all;
  53. return 404;
  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.ssl.conf_*;
  62. }