1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

check nginx

This commit is contained in:
1
2024-12-25 13:05:48 +06:00
parent 2ba223b666
commit 29886811e3
3 changed files with 17 additions and 21 deletions

View File

@@ -25,12 +25,12 @@ services:
nginx: nginx:
build: build:
context: ./docker/nginx context: .
dockerfile: Dockerfile dockerfile: docker/nginx/Dockerfile
container_name: support-nginx container_name: support-nginx
restart: unless-stopped restart: unless-stopped
ports: ports:
- "80:80" # Возвращаем стандартный порт - "80:80"
depends_on: depends_on:
- frontend - frontend
- backend - backend

View File

@@ -1,18 +1,17 @@
FROM nginx:alpine FROM nginx:alpine
# Copy configuration files # Создаем необходимые директории
COPY nginx.conf /etc/nginx/nginx.conf RUN mkdir -p /var/cache/nginx \
COPY conf.d/default.conf /etc/nginx/conf.d/default.conf /var/cache/nginx/client_temp \
/var/cache/nginx/proxy_temp \
RUN mkdir -p /var/cache/nginx \ -12,21 +12,11 @@ RUN mkdir -p /var/cache/nginx \ /var/cache/nginx/fastcgi_temp \
/var/cache/nginx/uwsgi_temp \ /var/cache/nginx/uwsgi_temp \
/var/cache/nginx/scgi_temp \ /var/cache/nginx/scgi_temp
/var/run \
&& chmod -R 755 /var/cache/nginx \
&& chmod -R 755 /etc/nginx \
&& chown -R nginx:nginx /var/cache/nginx \
&& chown -R nginx:nginx /etc/nginx
EXPOSE 8000 # Копируем конфигурацию
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1,20 +1,17 @@
server { server {
listen 80; listen 80;
server_name localhost; server_name _; # Обрабатывает все входящие запросы
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;
# Добавляем заголовки для отладки # Основной маршрут для фронтенда
add_header X-Debug-Path $request_uri;
add_header X-Debug-Root $document_root;
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate"; add_header Cache-Control "no-store, no-cache, must-revalidate";
} }
# Проксирование API запросов на бэкенд
location /api/ { location /api/ {
proxy_pass http://backend:8000/api/; proxy_pass http://backend:8000/api/;
proxy_http_version 1.1; proxy_http_version 1.1;