joomla.tpl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. location / {
  11. try_files $uri $uri/ /index.php?$args;
  12. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  13. expires max;
  14. }
  15. # deny running scripts inside writable directories
  16. location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
  17. return 403;
  18. error_page 403 /403_error.html;
  19. }
  20. location ~ [^/]\.php(/|$) {
  21. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  22. if (!-f $document_root$fastcgi_script_name) {
  23. return 404;
  24. }
  25. fastcgi_pass %backend_lsnr%;
  26. fastcgi_index index.php;
  27. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  28. include /etc/nginx/fastcgi_params;
  29. }
  30. }
  31. error_page 403 /error/404.html;
  32. error_page 404 /error/404.html;
  33. error_page 500 502 503 504 /error/50x.html;
  34. location /error/ {
  35. alias %home%/%user%/web/%domain%/document_errors/;
  36. }
  37. location ~* "/\.(htaccess|htpasswd)$" {
  38. deny all;
  39. return 404;
  40. }
  41. location /vstats/ {
  42. alias %home%/%user%/web/%domain%/stats/;
  43. include %home%/%user%/conf/web/%domain%.auth*;
  44. }
  45. include /etc/nginx/conf.d/phpmyadmin.inc*;
  46. include /etc/nginx/conf.d/phppgadmin.inc*;
  47. include %home%/%user%/conf/web/%domain%/nginx.conf_*;
  48. }