Всем привет. Поставил сборку в docker. Сборка Laravel+php+nginx+postgresql. При переходе на основную страницу Laravel ( / ) все нормально, но как после / начинаю вводить страницу, то NGINX выдает 404 ошибку. Что делать? Есть предположения?
Docker-compose.yml:
version: "3.9"
services:
db:
image: postgis/postgis:14-3.1-alpine
restart: unless-stopped
container_name: transaction-db
ports:
- "5432:5432"
environment:
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- ./storage/_db:/var/lib/postgresql/data
networks:
- transaction-db-network
app:
build:
context: ./
dockerfile: ./docker/php/Dockerfile
container_name: transaction-app
user: ${UID}:${GID}
restart: unless-stopped
volumes:
- ./:/var/www
- ./docker/php/extend-php.ini:/usr/local/etc/php/conf.d/extend-php-ini
depends_on:
- db
networks:
- transaction-db-network
- transaction-webserver-network
webserver:
image: nginx:1.21.4-alpine
container_name: transaction_webserver
restart: unless-stopped
volumes:
- ./:/var/www
- ./docker/nginx/conf.d/:/etc/nginx/conf.d/
- ./storage/docker/logs/nginx/:/var/log/nginx/
ports:
- "8876:80"
networks:
- transaction-webserver-network
networks:
transaction-db-network:
transaction-webserver-network:
App.conf:
server {
listen 80;
index index.php index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/public;
client_max_body_size 64M;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass transaction-app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location / {
try_files $uri $uri/ /index.php?$query_string
gzip_static on;
}
}