modx.tpl 1.8 KB

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