Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect to /apps/files/ after login ignores subdirectory (creates loop) #11656

Closed
EyMaddis opened this issue Oct 19, 2014 · 4 comments
Closed
Labels

Comments

@EyMaddis
Copy link

Hello,
there are several threads having problems with that
http://forum.owncloud.org/viewtopic.php?f=23&t=13501
http://forum.owncloud.org/viewtopic.php?f=26&t=20162

I just set up a brand new server and installed owncloud via the webinstaller. It is running on a nginx server with php5-fpm.

I tried several things to solve the loop, but nothing worked. Then I installed completely fresh, but this time in a subdirectory and I noticed that it redirected to the root of the domain domain.com/index.php/apps/files/

This seems to be the issue why I had infinite redirects when I installed it in the root directory.

Steps to reproduce

  1. Install in subdirectory (in my case even two: owncloud/owncloud)
  2. Complete setup with user etc., it will then redirect.

Expected behaviour

show the owncloud interface.

Actual behaviour

redirected to the root of the domain:
to http://cloud.madd.is/index.php/apps/files/ instead of the correct one:
http://cloud.madd.is/owncloud/owncloud/index.php/apps/files/

Server configuration

Operating system: Ubuntu 14.04 LTS

Web server: nginx (config without redirects)

Database: MySQL

PHP version: PHP Version 5.5.9-1ubuntu4.4 (http://cloud.madd.is/owncloud/owncloud/phpinfo.php)

ownCloud version: (see ownCloud admin page)

Updated from an older ownCloud or fresh install: fresh

List of activated apps: None (default installation)

The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'oce4e012fb13',
  'passwordsalt' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'cloud.madd.is',
  ),
  'datadirectory' => '/var/www/madd.is/cloud.madd.is/owncloud/owncloud/data',
  'dbtype' => 'mysql',
  'version' => '7.0.2.1',
  'dbname' => 'xxx',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
);

Are you using external storage, if yes which one: no

Are you using encryption: tried both

Nginx config

I tried several version, including the config from the documentation, but this one is the stripped down version I used in this test:

server {
    listen *:80;
listen *:443 ssl;
    ssl_certificate  /home/maddis/ssl/maddis.crt;
    ssl_certificate_key /home/maddis/ssl/maddis.key;
    server_name cloud.madd.is;

    access_log /var/log/nginx/cloudmaddis.access.log;
    error_log /var/log/nginx/cloudmaddis.error.log;

    root /var/www/madd.is/cloud.madd.is;
    index index.html index.htm index.php;

    location ~ [^/]\.php(/|$) {
        fastcgi_index index.php;
        include fcgi.conf;
        fastcgi_pass unix:/var/run/ajenti-v-php-fcgi-cloudmaddis-php-fcgi-0.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    }

}

Client configuration

Browser:
Google Chrome 38

Operating system:
Windows 8.1 64bit

Logs

ownCloud log (data/owncloud.log)

{"app":"PHP","message":"touch(): Unable to create file \/var\/www\/madd.is\/cloud.madd.is\/owncloud\/owncloud\/data\/owncloud.log because No such file or directory at \/var\/www\/madd.is\/cloud.madd.is\/owncloud\/owncloud\/lib\/private\/log\/owncloud.php#49","level":3,"time":"2014-10-19T01:21:09+00:00"}

Browser network log

Request Header:

GET /owncloud/owncloud/index.php/apps/files/ HTTP/1.1
Host: cloud.madd.is
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.36
Referer: http://cloud.madd.is/owncloud/owncloud/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: oce4e012fb13=tl9kosddvhacdvomeca96hnuk6; occ90f57636a=cg1fvbieook3tp66d16i0gt4k1

Response Header:

HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Sun, 19 Oct 2014 01:24:53 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.5.9-1ubuntu4.4
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: Sameorigin
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *
X-Robots-Tag: none
Location: http://cloud.madd.is/index.php/apps/files/
@ghost
Copy link

ghost commented Oct 19, 2014

Hi,

so you have used exactly this config http://doc.owncloud.org/server/7.0/admin_manual/installation/configuration_nginx.html with an OC installed to the root dir? Is this working for you?

If yes you need to do some additions to your config as the default nginx configs won't work in subdirs. See http://stackoverflow.com/questions/21645068/nginx-and-owncloud-in-subfolder for example.

@karlitschek Very likely more a config issue than a bug in OC

@EyMaddis
Copy link
Author

Ok, after a good night of sleep I noticed that I did not copy the fastcgi_params part correctly. Now I have #11243, but this ticket can get closed.

Thanks!

@tflidd
Copy link
Contributor

tflidd commented Oct 19, 2014

In your config.php you didn't set this option:

/* The automatic webroot detection of ownCloud can fail in certain reverse proxy and CLI/cron situations. This option allows to manually override the automatic detection. For example "/domain.tld/ownCloud". The value "/" can be used to remove the root. */
"overwritewebroot" => "",

@enoch85
Copy link
Member

enoch85 commented Oct 19, 2014

but this ticket can get closed.

@enoch85 enoch85 closed this as completed Oct 19, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants