Sonerezh / sonerezh

A self-hosted, web-based application to stream your music, everywhere.
https://www.sonerezh.bzh
GNU Affero General Public License v3.0
768 stars 122 forks source link

Nginx Server block CSS #295

Open deranjer opened 7 years ago

deranjer commented 7 years ago

Hi,

Was hoping I could have someone tell me why my server block doesn't work in nginx, I get 404 errors for the css (It is looking for it in the wrong location: https://domain.org/sonerezh/css/bootstrap.min.css).

Here is my server block:

        location /sonerezh/ {
                alias /var/www/sonerezh/app/webroot/;
                try_files $uri $uri/ /sonerezh//sonerezh/index.php?$args;

                # The section below handle the thumbnails cache, on the client (browser)
                # side (optional but recommended)
                location ~* /([^/]+_[0-9]+x[0-9]+(@[0-9]+x)?\.[a-z]+)$ {
                    try_files /img/resized/$1 /index.php?$args;
                    add_header Cache-Control 'public';
                    expires 14d;
                    access_log off;
                }
        }

        location ~ ^/sonerezh/(.+\.php)$ {
            alias /var/www/sonerezh/app/webroot/$1;
            fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
            include /etc/nginx/fastcgi.conf;
            fastcgi_index index.php;

        }
gs11 commented 7 years ago

The docs are in error here and I've submitted a pull request to fix this. See the needed change here: https://github.com/Sonerezh/docs/pull/10/commits/d2f08627285c0978b352f3cab4c8dd00963a303e

gs11 commented 7 years ago

@deranjer Did the updated docs help your cause?

deranjer commented 7 years ago

@gs11 No, that doesn't fix the issue, I get a 404 error for the login page.