A
A
artyak11212019-08-12 15:16:05
css
artyak1121, 2019-08-12 15:16:05

Nginx not handling css?

The ispmanager panel is used, the domain is created through it and nginx + php-fpm is used. When you try to enter the site, it is displayed like this:
5d5157f2520c6322029385.png
nginx config:

server {
  server_name site www.site;
  charset off;
  index index.php index.html;
  disable_symlinks if_not_owner from=$root_path;
  include /etc/nginx/vhosts-includes/*.conf;
  include /etc/nginx/vhosts-resources/site/*.conf;
  access_log /var/www/httpd-logs/site.access.log;
  error_log /var/www/httpd-logs/site.error.log notice;
  ssi on;
  set $root_path /var/www/www-root/data/www/site/public;
  root $root_path;
  listen ip:80;
  listen [ip::1]:80;
  location / {
    location ~ [^/]\.ph(p\d*|tml)$ {
      try_files /does_not_exists @php;
    }
  }
  location @php {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]";
    fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    include fastcgi_params;
  }
}

And when you try to follow a direct link to the js and css file, these files start downloading. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-08-12
@artyak1121

Looks like the Mime type is incorrect

http {
  include    conf/mime.types;
  ...
  ...
}

Or
location ~ ^/(images|javascript|js|css|flash|media|static)/  {
  include    conf/mime.types;
  root    /var/www/virtual/big.server.com/htdocs;
  expires 30d;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question