Drupal + nginx no CSS

I’m having issues with drupal on nginx. CSS is not displaying but the website is working and I have no clue why this is happening. I have installed nginx + php70-fpm on Mac OS El Capitan and I am using the configuration from drupal website with a slight mod:

The server name is also set in my /etc/hosts file as I am developing locally.

server {     server_name drupal.mac;     root /Users/fabriziomazzoni1/nginx/drupal/;         location = /favicon.ico {         log_not_found off;         access_log off;     }      location = /robots.txt {         allow all;         log_not_found off;         access_log off;     }      # Very rarely should these ever be accessed outside of your lan     location ~* .(txt|log)$ {         allow 192.168.0.0/16;         deny all;     }      location ~ ..*/.*.php$ {         return 403;     }      location ~ ^/sites/.*/private/ {         return 403;     }      # Allow "Well-Known URIs" as per RFC 5785     location ~* ^/.well-known/ {         allow all;     }      # Block access to "hidden" files and directories whose names begin with a     # period. This includes directories used by version control systems such     # as Subversion or Git to store control files.     location ~ (^|/). {         return 403;     }      location / {         # try_files $uri @rewrite; # For Drupal <= 6         try_files $uri /index.php?$query_string; # For Drupal >= 7     }      location @rewrite {         rewrite ^/(.*)$ /index.php?q=$1;     }      # Don't allow direct access to PHP files in the vendor directory.     location ~ /vendor/.*.php$ {         deny all;         return 404;     }      # controllers other than update.php in a future release.     location ~ '.php$|^/update.php' {        root /Users/fabriziomazzoni1/nginx/drupal/;        fastcgi_split_path_info ^(.+?.php)(|/.*)$;        #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini        include fastcgi.conf;        $document_root$fastcgi_script_name;        fastcgi_param PATH_INFO $fastcgi_path_info;        fastcgi_intercept_errors on;        fastcgi_index index.php;        fastcgi_pass 127.0.0.1:9000;    }      # Fighting with Styles? This little gem is amazing.     # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6     location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7         try_files $uri @rewrite;     }      location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {         expires max;         log_not_found off;     } } 

Attached is a screenshot of the web browser to better understand what is happening:

Web Browser Console

Sponsored by SupremePR
This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Drupal + nginx no CSS

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.