Answer the question
In order to leave comments, you need to log in
Why css is not loaded in nginx (local web server)?
server {
listen 80; # порт, прослушивающий nginx
server_name project.local; # доменное имя, относящиеся к текущему виртуальному хосту
root /home/komputator/project.local; # каталог в котором лежит проект, путь к точке входа
index index.php index.html;
# add_header Access-Control-Allow-Origin *;
location / {
# add_header Access-Control-Allow-Origin *;
try_files $uri $uri/ /index.php?$query_string;
}
location ~* \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# подключаем сокет php-fpm
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question