0

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

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

I dont know what happened, when i tried this for first time, it didn't work but after rebooting nginx was loading css

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.