CSS/JS/Images stopped loading suddenly (probably because slash arguments)

Re: CSS/JS/Images stopped loading suddenly (probably because slash arguments)

by Jason Hollowell -
Number of replies: 1
Picture of Particularly helpful Moodlers
Hello all,

Ok, well, my problems have been resolved...problem is that I'm not sure precisely why/how.

I did two things:

1. Added --> include /etc/nginx/mime.types; to my location file.

2. Went into Moodle and purged all cashes.

Everything looks perfect now! smile I'm not sure which of the two fixed my problem but I'm glad it's fixed. Now I need to go through the methodical process of making sure my instance of Moodle is safe and secure. Being very new to Nginx, I'm afraid there may be security holes that I'm not aware of...hopefully not but it's better to be safe than sorry. wink

Cheers

Jason
Average of ratings: Useful (1)
In reply to Jason Hollowell

Re: CSS/JS/Images stopped loading suddenly (probably because slash arguments)

by Christian Toller -

Hi there,

I was fighting the same issue today, but fresh install or changing PHP versions did not change anything for me.

But I managed to find a nginx configuration the did the job:

Of course you need to replace <domain-name> 

location ~ [^/]\.php(/|$) { 
 fastcgi_split_path_info ^(.+\.php)(/.+)$;
 fastcgi_index index.php;
 fastcgi_pass unix:/var/www/vhosts/system/<domain-name>/php-fpm.sock;
 include fastcgi_params;
 fastcgi_param PATH_INFO $fastcgi_path_info;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 }

That worked for me on Plesk Obsidian with PHP 7.4.22 and 7.3.29
Please note that I still have
- php-fpm served by Apache enabled
- in the nginx settings, only "proxy mode" is enabled, intelligent handling of static files, direct handling of static files and nginx caching are disabled

Using "php-fpm served by nginx" does not seem to work, at least not with the nginx config above.

Hope it helps,

Christian Toller

tethis IT