austintoddj / canvas

Publishing on your own terms
http://trycanvas.app
MIT License
3.23k stars 517 forks source link

Vendor folder gives 404 #1380

Closed flowroma closed 8 months ago

flowroma commented 8 months ago

Is there an existing issue for this?

Current Behavior

I get a blank screen after login and the console shows 404 for both the CSS and JS files at

https://mywebsite.com/vendor/canvas/css/app.css?id=fba32a97663f92be37a5efdb5fa67cfa and https://mywebsite.com/vendor/canvas/js/app.js?id=726331a48e3c937c97604ff72c4389f9

I believe it has more to do with some (nginx) configuration? Maybe someone has experience and can help me out

Expected Behavior

The blog system should appear after login

Steps To Reproduce

Here is my nginx configuration, I believe this is the issue

server {
    server_name mywebsite.com;
    root /var/www/laravel/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;
    charset utf-8;
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }

    listen 443 ssl;

Environment

Laravel 10
PHP 8.1
mySQL

Anything else?

No response

austintoddj commented 8 months ago

Hi @flowroma - Does the existing Laravel app work correctly? There shouldn't need to be any Nginx config changes to serve these assets.

flowroma commented 8 months ago

Hi @austintoddj Yes, everything else works perfectly. All other packages work fine. However, I have this issue with both Wink and Canvas. But I seemed to solve it by manually creating a vendor folder in my public folder and copying the files. That seemed to do the trick. I checked the permissions, it was no permission problem.

austintoddj commented 8 months ago

Glad you got it sorted out - I don't know why you'd need to manually create the vendor directory. If you run into any more issues don't hesitate to reach out.