dressed_for_succes_store/nginx/nginx.conf
2025-04-27 03:00:13 +07:00

37 lines
887 B
Nginx Configuration File

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream fastapi {
server fastapi:8000; # контейнер FastAPI по DNS-имени
}
upstream php {
server php:80; # контейнер PHP
}
server {
listen 80;
location /api/fastapi/ {
proxy_pass http://fastapi/; # проксируем на FastAPI
proxy_set_header Host $host;
}
location /api/php/ {
rewrite ^/api/php/(.*)$ /$1 break;
proxy_pass http://php/; # проксируем на PHP
proxy_set_header Host $host;
}
}
}