Nginx & ownCloud setup problem

Ask all your questions regarding OC 8.0 and 8.1 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
olivermtx
Newbie
Posts: 1
Joined: Fri Jun 24, 2016 4:14 pm

Nginx & ownCloud setup problem

Postby olivermtx » Fri Jun 24, 2016 5:10 pm

Hi,

I recently purchased a raspberry pi, and installed Nginx & ownCloud 8.0

I managed to get ownCloud server part to work properly, as I can connect on https://.../owncloud and upload documents over it.

But, as I downloaded the windows client, I didn't managed to connect to the server and received the following error message:

Error: Failed to connect to ownCloud at https://.../owncloud/status.php
Error downloading https://.../owncloud/status.php -server replied: Bad request

I suppose this comes from my Nginx config so I will quote it below.

Any help would be greatly appreciated.

upstream php-handler {
#server 127.0.0.1:9000;
server unix:/var/run/php5-fpm.sock;
}

server {

listen 80;
server_name mysite.com ;
# return 301 https://$server_name$request_uri; # enforce https
return 301 https://89.157...;
}


server {
listen 443 default_server ssl;

ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;

root /data/mysite.com/www;
index index.php index.html;

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/mysite.com/www;
}

# Error & Access logs
error_log /data/mysite.com/logs/error.log error;
access_log /data/mysite.com/logs/access.log;

client_max_body_size 10G; # set max upload size
fastcgi_buffers 64 4K;

# ownCloud blacklist
location ~ ^/owncloud/(?:\.htaccess|data|config|db_structure\.xml|README) {
deny all;
error_page 403 = /owncloud/core/templates/403.php;
}

location / {
index index.html index.php;
}

location /owncloud/ {
error_page 403 = /owncloud/core/templates/403.php;
error_page 404 = /owncloud/core/templates/404.php;

rewrite ^/owncloud/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/owncloud/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/owncloud/webdav(.*)$ /remote.php/webdav$1 redirect;

rewrite ^(/owncloud/core/doc[^\/]+/)$ $1/index.html;

# The following rules are only needed with webfinger
rewrite ^/owncloud/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/owncloud/.well-known/host-meta.json /public.php?service=host-meta-json last;
rewrite ^/owncloud/.well-known/carddav /remote.php/carddav/ redirect;
rewrite ^/owncloud/.well-known/caldav /remote.php/caldav/ redirect;

try_files $uri $uri/ index.php;
}
location ~ \.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
fastcgi_pass php-handler;
}

# Optional: set long EXPIRES header on static assets
location ~* ^/owncloud(/.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf))$ {
expires 30d;
access_log off; # Optional: Don't log access to assets
}

###### phpMyAdmin ############################################################
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
root /usr/share/;
#include fastcgi-gen.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 240;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
}

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Nginx & ownCloud setup problem

Postby RealRancor » Sun Jun 26, 2016 2:20 pm

Hi,

if you're installing a new system please directly install oC 9.0.2 and then use the known working nginx config provided here:

https://doc.owncloud.org/server/9.0/adm ... ud_9x.html
*gone*


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.0 and 8.1”

Who is online

Users browsing this forum: No registered users and 2 guests