modx.stpl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf;
  48. }
  49. location /error/ {
  50. alias %home%/%user%/web/%domain%/document_errors/;
  51. }
  52. location ~ /\.(?!well-known\/) {
  53. deny all;
  54. return 404;
  55. }
  56. location /vstats/ {
  57. alias %home%/%user%/web/%domain%/stats/;
  58. include %home%/%user%/web/%domain%/stats/auth.conf*;
  59. }
  60. include /etc/nginx/conf.d/phpmyadmin.inc*;
  61. include /etc/nginx/conf.d/phppgadmin.inc*;
  62. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  63. }