mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
21:41
This commit is contained in:
@@ -1,22 +1,23 @@
|
|||||||
|
<boltAction type="file" filePath="docker/nginx/conf.d/default.conf">
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Включаем автоиндексацию для отладки
|
# Отключаем автоиндексацию для продакшена
|
||||||
autoindex on;
|
autoindex off;
|
||||||
|
|
||||||
# Основной location для SPA
|
# Основной location для всех маршрутов
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html =404;
|
try_files $uri $uri/ /index.html;
|
||||||
add_header Cache-Control "no-cache";
|
add_header Cache-Control "no-cache";
|
||||||
}
|
}
|
||||||
|
|
||||||
# API requests
|
# API requests
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://backend:8000;
|
proxy_pass http://backend:8000/;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection 'upgrade';
|
proxy_set_header Connection 'upgrade';
|
||||||
@@ -27,10 +28,18 @@ server {
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Static files
|
# Static files caching
|
||||||
location /assets/ {
|
location /assets/ {
|
||||||
alias /usr/share/nginx/html/assets/;
|
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, no-transform";
|
add_header Cache-Control "public, no-transform";
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
# Prevent access to . files
|
||||||
|
location ~ /\. {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</boltAction>
|
||||||
|
</boltArtifact>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user