Jure
Jure
FFilament
Created by Jure on 7/9/2024 in #❓┊help
FileUpload 401 (Unauthorized)
Hi, the problem is that livewire.js is loaded from the wrong location. Our solution was to write a redirect on the NGNIX config file to cath livewire.js and load it from the right path. We did it like this:
server {

OTHER CONFIG ...

location /<FOLDER> {
alias /home/www/public<FOLDER>/public;
try_files $uri $uri/ @nested;

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param DOCUMENT_ROOT /home/www/public<FOLDER>/public;
}
}

location @nested {
rewrite /<FOLDER>/(.*)$ /<FOLDER>/index.php?/$1 last;
}

location /<FOLDER>/livewire/livewire.js {
alias /home/www/public/<FOLDER>/vendor/livewire/livewire/dist/livewire.js;
}

... REMAINING CONFIG
}
server {

OTHER CONFIG ...

location /<FOLDER> {
alias /home/www/public<FOLDER>/public;
try_files $uri $uri/ @nested;

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param DOCUMENT_ROOT /home/www/public<FOLDER>/public;
}
}

location @nested {
rewrite /<FOLDER>/(.*)$ /<FOLDER>/index.php?/$1 last;
}

location /<FOLDER>/livewire/livewire.js {
alias /home/www/public/<FOLDER>/vendor/livewire/livewire/dist/livewire.js;
}

... REMAINING CONFIG
}
This is inserted right after defining the root folder, certificates, headers, and index. I hope you can solve your problem with this.
19 replies
FFilament
Created by Jure on 7/9/2024 in #❓┊help
FileUpload 401 (Unauthorized)
I have found a solution how to setup the NGINX server for Laravel to work in a subfolder. Thank you again for your guidance. https://codewithsusan.com/notes/run-laravel-from-subdirectory-on-nginx
19 replies
FFilament
Created by Jure on 7/9/2024 in #❓┊help
FileUpload 401 (Unauthorized)
No description
19 replies
FFilament
Created by Jure on 7/9/2024 in #❓┊help
FileUpload 401 (Unauthorized)
There is no such folder. I'll try to make one and tets again in the morning. Thank you for now, I'll let you know how that works.
19 replies
FFilament
Created by Jure on 7/9/2024 in #❓┊help
FileUpload 401 (Unauthorized)
No description
19 replies
FFilament
Created by Jure on 7/9/2024 in #❓┊help
FileUpload 401 (Unauthorized)
No, Digitsl ocean own droplet...
19 replies