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;
}