@artyak1121

Nginx не обрабатывает css?

Используется панель ispmanager, домен создан через нее и используется nginx + php-fpm. При попытке войти на сайт отображается так:

5d5157f2520c6322029385.png

Конфиг nginx:

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 webmaster@site";
		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;
	}
}


И при попытке перейти по прямой ссылке на js и css файл эти файлы начинают скачиваться. В чем может быть проблема?
  • Вопрос задан
  • 1541 просмотр
Решения вопроса 1
deepblack
@deepblack
Видимо неверно указан Mime type
http {
  include    conf/mime.types;
  ...
  ...
}

Или
location ~ ^/(images|javascript|js|css|flash|media|static)/  {
  include    conf/mime.types;
  root    /var/www/virtual/big.server.com/htdocs;
  expires 30d;
}
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы