From 722ceb88df5861d346518ab12ce7da0a75fde931 Mon Sep 17 00:00:00 2001 From: ackFromRedmi Date: Sat, 14 Feb 2026 23:48:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=B8=D0=BC=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=20=D0=BD=D0=B4=D0=B6=D0=B8=D0=BD?= =?UTF-8?q?=D0=BA=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/Dockerfile | 3 +++ nginx/default.conf | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 nginx/Dockerfile create mode 100644 nginx/default.conf diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..ed481dd --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,3 @@ +# FROM nginx:latest +# # Копируем твой конфиг прямо в папку конфигураций nginx внутри образа +# COPY default.conf /etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..2ef7ce9 --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,35 @@ +upstream django_app { + server web:8000; +} + +server { + listen 80; + server_name localhost; # Можешь заменить на свой IP или домен + + # Максимальный размер загружаемого файла (важно для чертежей/моделей) + client_max_body_size 100M; + + # Основной прокси на Django + location / { + proxy_pass http://django_app; + 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; + proxy_redirect off; + } + + # Статические файлы (STATIC_ROOT в Django) + location /static/ { + alias /app/staticfiles/; + expires 30d; + add_header Cache-Control "public, no-transform"; + } + + # Медиа файлы (MEDIA_ROOT в Django) + location /media/ { + alias /app/media/; + expires 30d; + add_header Cache-Control "public, no-transform"; + } +} \ No newline at end of file