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