owncloud.stpl 2.7 KB

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