modx.stpl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. server {
  2. listen %ip%:%web_ssl_port%;
  3. server_name %domain_idn% %alias_idn%;
  4. root %sdocroot%;
  5. index index.php index.html index.htm;
  6. access_log /var/log/nginx/domains/%domain%.log combined;
  7. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  8. error_log /var/log/nginx/domains/%domain%.error.log error;
  9. ssl on;
  10. ssl_certificate %ssl_pem%;
  11. ssl_certificate_key %ssl_key%;
  12. # if you need to rewrite www to non-www uncomment bellow
  13. # if ($host != '%domain%' ) {
  14. # rewrite ^/(.*)$ https://%domain%/$1 permanent;
  15. # }
  16. location = /favicon.ico {
  17. log_not_found off;
  18. access_log off;
  19. }
  20. location = /robots.txt {
  21. allow all;
  22. log_not_found off;
  23. access_log off;
  24. }
  25. location / {
  26. try_files $uri $uri/ @rewrite;
  27. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  28. expires max;
  29. }
  30. }
  31. location @rewrite {
  32. rewrite ^/(.*)$ /index.php?q=$1;
  33. }
  34. location ~ \.php$ {
  35. try_files $uri =404;
  36. fastcgi_pass %backend_lsnr%;
  37. fastcgi_index index.php;
  38. fastcgi_param SCRIPT_FILENAME $request_filename;
  39. include /etc/nginx/fastcgi_params;
  40. }
  41. error_page 403 /error/404.html;
  42. error_page 404 /error/404.html;
  43. error_page 500 502 503 504 /error/50x.html;
  44. location /error/ {
  45. alias %home%/%user%/web/%domain%/document_errors/;
  46. }
  47. location ~* "/\.(htaccess|htpasswd)$" {
  48. deny all;
  49. return 404;
  50. }
  51. location /vstats/ {
  52. alias %home%/%user%/web/%domain%/stats/;
  53. include %home%/%user%/conf/web/%domain%.auth*;
  54. }
  55. include /etc/nginx/conf.d/phpmyadmin.inc*;
  56. include /etc/nginx/conf.d/phppgadmin.inc*;
  57. include /etc/nginx/conf.d/webmail.inc*;
  58. include %home%/%user%/conf/web/snginx.%domain%.conf*;
  59. }