Запускаю nginx в docker контейнере, меняю путь к index файлу, но nginx не фиксирует этих изменений "location /"
server {
listen 80;
server_name _;
server_tokens off;
client_max_body_size 20M;
location / {
root /usr/share/nginx/html/public;
index index.html index.html;
try_files $uri $uri/ /index.html;
}
location /django_api {
try_files $uri @proxy_django_api;
}
location /admin {
try_files $uri @proxy_django_api;
}
location @proxy_django_api {
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Url-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://django:8000;
}
}
docker:
FROM node:16.13.1-alpine as react_build
WORKDIR /frontend
COPY . .
FROM nginx:1.21.6-alpine
COPY --from=react_build /frontend /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
EXPOSE 80
CMD ["nginx","-g","daemon off;"]
docker-compose:
react:
build: ./frontend
ports:
- "80:80"