pyrocms.tpl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. location /installer {
  10. try_files $uri $uri/ /installer/index.php;
  11. }
  12. location / {
  13. try_files $uri $uri/ /index.php;
  14. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  15. expires max;
  16. }
  17. location ~ [^/]\.php(/|$) {
  18. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  19. if (!-f $document_root$fastcgi_script_name) {
  20. return 404;
  21. }
  22. fastcgi_pass %backend_lsnr%;
  23. fastcgi_index index.php;
  24. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  25. include /etc/nginx/fastcgi_params;
  26. }
  27. }
  28. location = /robots.txt { access_log off; log_not_found off; }
  29. location = /favicon.ico { access_log off; log_not_found off; }
  30. location ~ /\. { access_log off; log_not_found off; deny all; }
  31. location ~ ~$ { access_log off; log_not_found off; deny all; }
  32. error_page 403 /error/404.html;
  33. error_page 404 /error/404.html;
  34. error_page 500 502 503 504 /error/50x.html;
  35. location /error/ {
  36. alias %home%/%user%/web/%domain%/document_errors/;
  37. }
  38. location ~* "/\.(htaccess|htpasswd)$" {
  39. deny all;
  40. return 404;
  41. }
  42. include /etc/nginx/conf.d/phpmyadmin.inc*;
  43. include /etc/nginx/conf.d/phppgadmin.inc*;
  44. include /etc/nginx/conf.d/webmail.inc*;
  45. include %home%/%user%/conf/web/nginx.%domain%.conf*;
  46. }