From ab31a44d64d5b6867f6e6bc5df38303e7c6ec2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 7 Jun 2012 21:41:31 +0200 Subject: [PATCH] owncloud: updates from ntblock --- .../2012-06-03-owncloud-4-and-nginx.markdown | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/source/_posts/2012-06-03-owncloud-4-and-nginx.markdown b/source/_posts/2012-06-03-owncloud-4-and-nginx.markdown index c9a07cf..6d3ff5e 100644 --- a/source/_posts/2012-06-03-owncloud-4-and-nginx.markdown +++ b/source/_posts/2012-06-03-owncloud-4-and-nginx.markdown @@ -6,23 +6,38 @@ comments: true categories: --- +**updated at Do 7. Jun 2012** + +Short after writing this entry, I discover [a good one][ntblock]. + Nginx don't understand the .htaccess, which is shipped with owncloud. So some rewrites, required by the webdav implementation, aren't applied. To get owncloud running, some additional options are necessary: +Nginx +----- + ``` nginx nginx.conf upstream backend { unix:/var/run/php-fpm.sock; # <--- edit me } + +# force https server { - listen 80; - ##If you want ssl, which I strongly recommend - # listen 443 ssl; - # ssl_certificate /etc/ssl/nginx/nginx.crt; - # ssl_certificate_key /etc/ssl/nginx/nginx.key; + listen 80; + server_name cloud.site.com; + rewrite ^ https://$server_name$request_uri? permanent; +} + +server { + listen 443 ssl; + ssl_certificate /etc/ssl/nginx/nginx.crt; + ssl_certificate_key /etc/ssl/nginx/nginx.key; server_name cloud.site.com; # <--- edit me root /var/web/MyOwncloud; # <--- edit me + index index.php; + client_max_body_size 20M; # set maximum upload size access_log /var/log/nginx/cloud.access_log main; error_log /var/log/nginx/cloud.error_log info; @@ -40,6 +55,7 @@ server { location @webdav { include fastcgi_params; fastcgi_pass backend; + fastcgi_param HTTPS on; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } @@ -47,6 +63,7 @@ server { location ~ .php$ { include fastcgi_params; fastcgi_pass backend; + fastcgi_param HTTPS on; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } @@ -91,3 +108,15 @@ fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; ``` + +PHP +--- +If your upload size is still lower than the one set in nginx's configuration, increase the size in the php.ini as described [here](http://www.radinks.com/upload/config.php) + + +Referenzes +---------- + +[Setting up Nginx and Owncloud - nblock.org][ntblock] + +[ntblock]: http://nblock.org/2012/03/12/nginx-and-owncloud