php - Nginx/OwnCloud requests being sent to wrong directory -
i have server running nginx instance of owncloud. root of webserver @ /data/domain.com/www/
, root of owncloud files /data/domain.com/www/cloud/
.
the owncloud pages load fine, can browse , upload files. have z-push working, cannot share files. when go share, request sent wrong directory per errors:
2016/06/01 20:47:31 [error] 7758#0: *117 "/data/domain.com/www/ocs-provider/index.php" not found (2: no such file or directory), client: 10.1.1.1, server: domain.com, request: "get /ocs-provider/ http/1.1", host: "domain.com" 2016/06/01 20:47:31 [error] 7758#0: *121 open() "/data/domain.com/www/ocs/v1.php/cloud/shares/36/unshare" failed (2: no such file or directory), client: 10.1.1.1, server: domain.com, request: "get /ocs/v1.php/cloud/shares/36/unshare?format=json http/1.1", host: "domain.com"
the folders, ocs , ocs-provider both located in cloud directory, inside of www directory. essentially, requests folders being pointed @ directory above.
interestingly, lists host domain.com - owncloud instance running cloud.domain.com
. initial thoughts owncloud pointing requests @ wrong domain, in config.php owncloud have following:
'trusted_domains' => array ( 0 => 'cloud.domain.com', 1 => 'domain.com', ), 'overwrite.cli.url' => 'https://cloud.domain.com/',
for cloud.domain.com vhosts config have following:
server { listen 80; ## listen ipv4; line default , implied server_name cloud.domain.com; return 302 https://$host$request_uri; error_log /var/log/nginx_error.log error; access_log /var/log/nginx_access.log; } server { listen 443 ssl; server_name cloud.domain.com; #####ssl block client_max_body_size 10g; fastcgi_buffers 64 4k; gzip off; root /data/domain.com/www/cloud/; index index.php index.html index.htm; error_page 403 /core/templates/403.php; error_page 404 /core/templates/404.php; location = /robots.txt { allow all; log_not_found off; access_log off; } error_log /var/log/nginx_error.log error; access_log /var/log/nginx_access.log; location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|readme){ deny all; } rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; index index.php; location / { # following 2 rules needed webfinger rewrite ^/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; try_files $uri $uri/ =404; } 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 unix:/var/run/php5-fpm.sock; fastcgi_intercept_errors on; } location ~* \.(?:css|js)$ { add_header cache-control "public, max-age=7200"; # add headers serve security related headers add_header strict-transport-security "max-age=15768000; includesubdomains; preload;"; add_header x-content-type-options nosniff; add_header x-frame-options "sameorigin"; add_header x-xss-protection "1; mode=block"; add_header x-robots-tag none; # optional: don't log access assets access_log off; } # optional: don't log access other assets location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|swf)$ { access_log off; }
}
any ideas why requests going wrong place , can rectify? i'm running out of ideas! :(