Moodle 3.0 - CSS and Javascript don't load - Requests to NGINX aren't compatible with the real paths
Please add below configuration code on your server part of nginx.conf file.
location / { root /var/www/yourwebsite.com; index index.php index.html index.htm; # moodle rewrite rules rewrite ^/(.*.php)(/)(.*)$ /$1?file=/$3 last; } # php parsing location ~ .php$ { root /var/www/yourwebsite.com; try_files $uri =404; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_buffer_size 128k; fastcgi_buffers 256 4k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; }
Heres my plain nginx config which works fine for moodle >=3.1
server { listen 80; server_name someservername.com; root /var/www; index index.php index.html index.htm;location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}}