owncloud.stpl 2.7 KB

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