ли ingress заменить контейнер nginx с таким конфигом:
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/www/html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1: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
version: '3'
services:
nginx:
image: nginx:stable-alpine
ports:
- "80:80"
volumes:
- ./www:/var/www
- ./images/nginx:/etc/nginx/conf.d
- ./data/logs:/var/log/nginx/
depends_on:
- php
php:
build:
context: ./images/php
dockerfile: Dockerfile
volumes:
- ./www:/var/www
- ./images/php/php.ini:/usr/local/etc/php/php.ini
ports:
- "9099:9000"
И да, и нет
Обсуждают сегодня