Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
PHP-FPM doesn't work in docker-compose (404 not found)

/etc/nginx/conf.d/default.conf

server {
    server_name site.com; # для заголовка Host
    listen 80; # слушаем 443 порт
    root /code; # Папка с сайтом
    index index.php; # страница по умолчанию

    access_log /var/log/access.log; # путь куда писать логи
    error_log /var/log/error.log; # аналогично

    location /
    {
        try_files $uri =404;
    }

    location ~ \.php$ {
        fastcgi_pass   php:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }


}

docker-compose.yml

version: "3.4"

services:
    nginx:
        image: nginx
        container_name: nginx
        ports:
            - "80:80"
        volumes:
          - ./code:/code
        links:
            - php
    php:
        image: php:7.4-fpm
        container_name: php-fpm
        volumes:
          - ./code:/code

I've already checked that is php-fpm avaiable from nginx container at php:9000 address. Static files work fine, but index.php with code doesn't work.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!