shqnks
shqnks

Reputation: 246

NGINX doesn't load css files (wordpress implementation)

I am currently trying to implement a wordpress on a sub-domain using nginx.

I've installed all the dependencies (php 7.2, mariadb, mysql) and configured it all.

When I try to access to the website, here is what I got :

screen wordpress on nginx

To be more explicit: here's what I did to configure nginx in order to use wordpress:

sudo nano /etc/nginx/conf.d/location.conf

server{
   server_name subdomain.domain.fr;
   root /home/domain/wordpress/;
   location / {
      fastcgi_pass unix:/run/php/php7.2-fpm.sock;
      include fastcgi_params;
      index index.php index.html index.htm;
      try_files $uri $uri/ =404;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param SCRIPT_NAME $fastcgi_script_name;
   }
}

My problem is that when I first use a wordpress website, I'm used to see some CSS on the page. When I inspect this page, I can see that the css files are included, but not used. I dont understand why. I think I have a privilege issue or anything else, but it's my first time using nginx with wordpress so I must have done something wrong:

failed to load

Thanks for your help

Upvotes: 0

Views: 3061

Answers (1)

shqnks
shqnks

Reputation: 246

I've found a solution that works perfectly:

adding this solved all my problems :

location ~* \.(?:css|js|map|jpe?g|gif|png)$ { }

Thanks for your help

Upvotes: 2

Related Questions