Livewire nginx - cloudpanel
Have a issue with Livewire on CloudPanel. Here is nginx error log:
2023/12/04 21:55:02 [error] 86630#86630: *31643 open() "/home/soc/htdocs/site_url/public/livewire/livewire.js" failed (2: No such file or directory), client: 94.250.12.155, server: site_url, request: "GET /livewire/livewire.js?id=c4077c56 HTTP/2.0", host: "site_url", referrer: "https://site_url/login?" Console log: GET https://site_url/livewire/livewire.js?id=c4077c56 [HTTP/2 404 97ms]
GET https://site_url/livewire/livewire.js?id=c4077c56 Status 404 VersionHTTP/2 Transferred244 B (146 B size) Referrer Policysame-origin DNS ResolutionSystem
content-encoding br content-type text/html date Mon, 04 Dec 2023 20:55:02 GMT server nginx vary Accept-Encoding X-Firefox-Spdy h2
Accept ... Host site_url Referer https://site_url/login? Sec-Fetch-Dest script Sec-Fetch-Mode no-cors Sec-Fetch-Site same-origin Sec-GPC 1 Has anyone had similar problems before?
2023/12/04 21:55:02 [error] 86630#86630: *31643 open() "/home/soc/htdocs/site_url/public/livewire/livewire.js" failed (2: No such file or directory), client: 94.250.12.155, server: site_url, request: "GET /livewire/livewire.js?id=c4077c56 HTTP/2.0", host: "site_url", referrer: "https://site_url/login?" Console log: GET https://site_url/livewire/livewire.js?id=c4077c56 [HTTP/2 404 97ms]
GET https://site_url/livewire/livewire.js?id=c4077c56 Status 404 VersionHTTP/2 Transferred244 B (146 B size) Referrer Policysame-origin DNS ResolutionSystem
content-encoding br content-type text/html date Mon, 04 Dec 2023 20:55:02 GMT server nginx vary Accept-Encoding X-Firefox-Spdy h2
Accept ... Host site_url Referer https://site_url/login? Sec-Fetch-Dest script Sec-Fetch-Mode no-cors Sec-Fetch-Site same-origin Sec-GPC 1 Has anyone had similar problems before?
2 Replies
Nginx config: server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
{{ssl_certificate_key}}
{{ssl_certificate}}
server_name site_url;
{{root}}
{{nginx_access_log}}
{{nginx_error_log}}
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
location ~ /.well-known {
auth_basic off;
allow all;
}
{{settings}}
location / {
{{varnish_proxy_pass}}
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header X-Varnish;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_connect_timeout 720;
proxy_send_timeout 720;
proxy_read_timeout 720;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
}
location ~* ^.+.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ {
add_header Access-Control-Allow-Origin "";
expires max;
access_log off;
}
if (-f $request_filename) {
break;
}
}
server {
listen 8080;
listen [::]:8080;
server_name site_url;
{{root}}
try_files $uri $uri/ /index.php?$args;
#index index.php index.html;
location ~ .php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files $uri =404;
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
fastcgi_param HTTPS "on";
fastcgi_param SERVER_PORT 443;
fastcgi_pass 127.0.0.1:{{php_fpm_port}};
fastcgi_param PHP_VALUE "{{php_settings}}";
}
location ~ ^.+.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ {
add_header Access-Control-Allow-Origin "*";
expires max;
access_log off;
}
if (-f $request_filename) {
break;
}
}
open() "/home/soc/htdocs/site_url/public/livewire/livewire.js" failed (2: No such file or directory)The error message is pretty clear: you don't have the livewire directory and js file inside your server's
public
dir.
That means you didn't upload those files to the server.