1

I have a VPS set up with php-fpm and nginx (with ssl). I have set up Tiny Tiny RSS already, and it works just fine. However, I recently attempted to set up Owncloud, and instantly hit a roadblock.

I visited the index page to do the initial set up, and there was absolutely no styling at all. I looked in Firefox's console, and saw several 404 errors. Looking closely, I saw that all the paths to the assets were wrong. Instead of requesting http://mydomain.com/owncloud/some/important/component.js, it requested http://mydomain.com/usr/share/nginx/html/owncloud/some/important/component.js.

It would seem that php is doing something wrong when it's processing the pages. I don't have this problem with Tiny Tiny RSS, so I would assume it has something to do with the way Owncloud was written.

I'm assuming there's a php.ini key I have to change. Any ideas?

The following is the content of my server block:

            listen 443 ssl;
            ssl_certificate /var/ssl/secret/sauce.key
            ssl_certificate_key /var/ssl/secret/sauce.key;
            server_name localhost 127.0.0.1 mydomain.com;
            root /usr/share/nginx/html;
            index index.html index.htm index.php;
            client_max_body_size 1000M;

            location / {
                    try_files $uri $uri/ @webdav =404;
            }

            location ~ \.php$ { 
                    include fastcgi_params;
                    fastcgi_index index.php;
                    try_files $1 = 404;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_param HTTPS on;
                    fastcgi_pass 127.0.0.1:9000;
            }

            location ~ ^/owncloud/(data|config|\.ht|db_structure\.xml|README) {
                    deny all;
            }

            location @webdav {
                    fastcgi_split_path_info ^(.+\.php)(/.*)$;
                    fastcgi_pass 127.0.0.1:9000;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_param HTTPS on;
                    include fastcgi_params;
            }

I realise that this isn't the complete configuration that the Owncloud documentation recommends, but I generally like to get a minimal working configuration and work up in order to learn how everything works. Reviewing the configuration options I left out, there didn't seem to be any that affected php processing, so I'm assuming it's fine. Otherwise, I would like to know what nginx directive I'm missing and why it's important.

MetaNova
  • 171

2 Answers2

0

I'm assuming there's a php.ini key I have to change. Any ideas?

No, your application is likely configured wrong - Owncloud's PHP is generating those paths. Make sure you configured the URL path correctly in Owncloud.

EEAA
  • 110,608
0

Create a new virtual host for owncloud, and just edit the root and the upstream (either sock or port ), I already have a functioning owncloud server and it works fine.

Nginx configuration for owncloud

replace the root line and server in the upstream

I'm assuming you know how to create a virtual server, if not tell me so I could provide an explanation for that too.

EDIT

About ssl, one IP, and one virtual server:

Not really, It depends on what your ssl was bought for, if it's a single domain ssl like for example example.com or store.example.com, you can have as many sites as wanted on the same IP but the SSL will only be valid for that one domain you bought it for, unless you bought a wild card SSL, in that case it might support *.example.com

anyways, too have SSL on my server and it's only for domain.com and www.domain.com, I used it on my cloud server which was hosted on cloud.domain.com the only downside for it is that you get that yellow page warning because the domain isn't matching the one the ssl was bought for, I tell the browser to ignore that warning and save the exception and that's it, also the same for the sync client, it told me if i want to ignore the warning or not and it works just fine.

If you don't want to face that warning then yes you need to create the own cloud server under the same virtual host, not because of the IP, but because the name that the ssl was bought for.

Tell me which do you want and I'll help you with either.