Files
iiEasy/nginx/conf.d/default.conf

85 lines
2.9 KiB
Plaintext
Raw Normal View History

# Обратный прокси: единственная точка входа. Снаружи открыт только порт 85.
# /api, /uploads, /admin -> Strapi (внутренний strapi:1340)
# / -> фронт (frontend:80)
server {
listen 80;
server_name _;
client_max_body_size 200M;
proxy_connect_timeout 60s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
# Strapi API
location /api {
proxy_pass http://strapi:1337;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Strapi Upload plugin API (/api/upload уже под /api; на всякий случай явно)
location /upload {
proxy_pass http://strapi:1337;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 200M;
}
# Strapi uploads (медиа-файлы)
location /uploads {
proxy_pass http://strapi:1337;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Strapi admin panel
location /admin {
proxy_pass http://strapi:1337;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Strapi Content Manager API (/content-manager/init и др.)
location /content-manager {
proxy_pass http://strapi:1337;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Strapi Content-Type Builder API (/content-type-builder/schema и др.)
location /content-type-builder {
proxy_pass http://strapi:1337;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Фронт: статический сайт
location / {
proxy_pass http://frontend:80;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}