owncloud.tpl 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 = /favicon.ico {
  10. log_not_found off;
  11. access_log off;
  12. }
  13. location = /robots.txt {
  14. allow all;
  15. log_not_found off;
  16. access_log off;
  17. }
  18. rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
  19. rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
  20. rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
  21. error_page 403 = /core/templates/403.php;
  22. error_page 404 = /core/templates/404.php;
  23. location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
  24. deny all;
  25. }
  26. location / {
  27. # The following 2 rules are only needed with webfinger
  28. rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  29. rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
  30. rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
  31. rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
  32. rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
  33. try_files $uri $uri/ /index.php;
  34. location ~ \.php(?:$|/) {
  35. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  36. include /etc/nginx/fastcgi_params;
  37. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  38. fastcgi_param PATH_INFO $fastcgi_path_info;
  39. #fastcgi_param HTTPS on;
  40. fastcgi_pass %backend_lsnr%;
  41. }
  42. }
  43. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  44. expires max;
  45. # Some basic cache-control for static files to be sent to the browser
  46. add_header Pragma public;
  47. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  48. }
  49. #error_page 403 /error/404.html;
  50. #error_page 404 /error/404.html;
  51. error_page 500 502 503 504 /error/50x.html;
  52. location /error/ {
  53. alias %home%/%user%/web/%domain%/document_errors/;
  54. }
  55. location ~* "/\.(htaccess|htpasswd)$" {
  56. deny all;
  57. return 404;
  58. }
  59. location /vstats/ {
  60. alias %home%/%user%/web/%domain%/stats/;
  61. include %home%/%user%/conf/web/%domain%.auth*;
  62. }
  63. include /etc/nginx/conf.d/phpmyadmin.inc*;
  64. include /etc/nginx/conf.d/phppgadmin.inc*;
  65. include /etc/nginx/conf.d/webmail.inc*;
  66. include %home%/%user%/conf/web/nginx.%domain%.conf*;
  67. }