modx.stpl 1.9 KB

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