The .inde class does not get the style from main.css. The index.php file and main.css are in the same directory

LAN settings for ubuntu

index.php

<?php echo "HI"; ?> <hr> <link rel="stylesheet" type="text/css" href="main.css"> <div class="inde">Some stupid text</div> 

main.css

 .inde{ margin-top: 100px; } 

docker-compose.yml

 version: "3.7" services: nginx: image: tutum/nginx ports: - "80:80" links: - php-fpm volumes: - ./nginx/default:/etc/nginx/sites-available/default - ./nginx/default:/etc/nginx/sites-enabled/default - ./logs/nginx-access.log:/var/log/nginx/access.log - ./logs/nginx-error.log:/var/log/nginx/error.log php-fpm: image: php:fpm ports: - "9000:9000" volumes: - ./public:/application/public 

default

 server { listen 80 default; root /docker_with_php-master/public; index index.php; if (!-e $request_filename) { rewrite ^.*$ /index.php last; } location ~ \.php$ { fastcgi_pass php-fpm:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log"; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; include fastcgi_params; } } 

    1 answer 1

    For nginx also add volume to the directory with files:

      - ./public:/application/public 

    After that, in the configuration of the nzhinks set the main directory:

      root /application/public;