0

I am trying to configure CakePHP 3 on OSX running nginx. The default page reports that everything is working except URL rewriting. However, I have URL rewriting working for page URLs (just followed the instructions for nginx setup). The only thing that's not working is loading static assets from webroot. I've been digging through a ton of similar stackoverflow questions and none of the responses seem to work.

vhost file:

server {
    listen       80;
    server_name  albums.dev;
    root       /Users/username/Sites/albums;

    access_log  /Library/Logs/default.access.log  main;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }  

    location ~ \.php$ {
        include   /usr/local/etc/nginx/conf.d/php-fpm;
    }
}

Again: The entire CakePHP application seems to be working correctly, except the static assets in /webroot/ are coming up as 404.

1 Answer 1

1

change the root .. you must point to webroot of your project

if you want i can give my conf to you

Sign up to request clarification or add additional context in comments.

1 Comment

Update: I resolved this by copying webroot files from vendor/cakephp/debug_kit/webroot into webroot/debug_kit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.