Hello developer friends!
I'm having a problem with NGINX where the application root is not found, reminding me that I need a "mod_rewrite" to make my URLs beautiful. I'll leave the NGINX settings and docker-compose.yml. Vlw: metal:
site.conf
server {
index index.php index.html;
server_name php-docker.local;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /app/public;
location ~ \.php$ {
try_files $uri $uri/ /index.php?$args;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
docker-compose.yml
version: '3.2'
services:
nginx:
image: nginx:latest
ports:
- "8000:80"
volumes:
- .:/app
- ./site.conf:/etc/nginx/conf.d/default.conf
links:
- php
php:
image: php:7-fpm
volumes:
- .:/app