sonerezh
sonerezh copied to clipboard
Nginx Server block CSS
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;
}
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
@deranjer Did the updated docs help your cause?
@gs11 No, that doesn't fix the issue, I get a 404 error for the login page.