owncloud.stpl 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #=======================================================================#
  2. # Default Web Domain Template #
  3. # DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
  4. #=======================================================================#
  5. server {
  6. listen %ip%:%web_ssl_port% ssl http2;
  7. server_name %domain_idn% %alias_idn%;
  8. root %sdocroot%;
  9. index index.php index.html index.htm;
  10. access_log /var/log/nginx/domains/%domain%.log combined;
  11. access_log /var/log/nginx/domains/%domain%.bytes bytes;
  12. error_log /var/log/nginx/domains/%domain%.error.log error;
  13. ssl_certificate %ssl_pem%;
  14. ssl_certificate_key %ssl_key%;
  15. ssl_stapling on;
  16. ssl_stapling_verify on;
  17. include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
  18. location = /favicon.ico {
  19. log_not_found off;
  20. access_log off;
  21. }
  22. location = /robots.txt {
  23. allow all;
  24. log_not_found off;
  25. access_log off;
  26. }
  27. rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
  28. rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
  29. rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
  30. error_page 403 = /core/templates/403.php;
  31. error_page 404 = /core/templates/404.php;
  32. error_page 500 502 503 504 /error/50x.html;
  33. location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
  34. deny all;
  35. }
  36. location / {
  37. # The following 2 rules are only needed with webfinger
  38. rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  39. rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
  40. rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
  41. rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
  42. rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
  43. try_files $uri $uri/ /index.php;
  44. location ~ \.php(?:$|/) {
  45. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  46. include /etc/nginx/fastcgi_params;
  47. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  48. fastcgi_param PATH_INFO $fastcgi_path_info;
  49. #fastcgi_param HTTPS on;
  50. fastcgi_pass %backend_lsnr%;
  51. }
  52. }
  53. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  54. expires max;
  55. fastcgi_hide_header "Set-Cookie";
  56. # Some basic cache-control for static files to be sent to the browser
  57. add_header Pragma public;
  58. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  59. }
  60. location /error/ {
  61. alias %home%/%user%/web/%domain%/document_errors/;
  62. }
  63. location ~* "/\.(htaccess|htpasswd)$" {
  64. deny all;
  65. return 404;
  66. }
  67. location /vstats/ {
  68. alias %home%/%user%/web/%domain%/stats/;
  69. include %home%/%user%/web/%domain%/stats/auth.conf*;
  70. }
  71. include /etc/nginx/conf.d/phpmyadmin.inc*;
  72. include /etc/nginx/conf.d/phppgadmin.inc*;
  73. include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
  74. }