Advertisement
Guest User

owncloud config

a guest
May 21st, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. upstream php-handler {
  2. server 192.168.178.200:8000;
  3. #server unix:/var/run/php5-fpm.sock;
  4. }
  5.  
  6. server {
  7. listen 80;
  8. server_name cloud.DOMAIN.ch;
  9. return 301 https://$server_name$request_uri; # redirect all to use ssl
  10. }
  11.  
  12.  
  13. server {
  14. listen 443 ssl;
  15. server_name cloud.DOMAIN.ch;
  16.  
  17. #SSL Certificate you created
  18. ssl_prefer_server_ciphers on;
  19. ssl_certificate_key /config/keys/privkey.pem;
  20. ssl_certificate /config/keys/fullchain.pem;
  21.  
  22. # owncloud path
  23. root /usr/share/nginx/html/owncloud/;
  24.  
  25. client_max_body_size 10G; # set max upload size
  26. fastcgi_buffers 64 4K;
  27.  
  28. rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
  29. rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
  30. rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
  31.  
  32. index index.php;
  33. error_page 403 /core/templates/403.php;
  34. error_page 404 /core/templates/404.php;
  35.  
  36.  
  37. location = /robots.txt {
  38. allow all;
  39. log_not_found off;
  40. access_log off;
  41. }
  42.  
  43. location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
  44. deny all;
  45. }
  46.  
  47. location / {
  48. # The following 2 rules are only needed with webfinger
  49.  
  50. rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  51. rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
  52.  
  53. rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
  54. rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
  55.  
  56. rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
  57.  
  58. try_files $uri $uri/ index.php;
  59. }
  60.  
  61. location ~ ^(.+?\.php)(/.*)?$ {
  62. try_files $1 = 404;
  63.  
  64. include fastcgi_params;
  65. fastcgi_param SCRIPT_FILENAME $document_root$1;
  66. fastcgi_param PATH_INFO $2;
  67. fastcgi_param HTTPS on;
  68. fastcgi_pass php-handler;
  69. }
  70.  
  71. # Optional: set long EXPIRES header on static assets
  72. location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
  73. expires 30d;
  74. # Optional: Don't log access to assets
  75. access_log off;
  76. }
  77.  
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement