Update k8s/games/minecraft/deployments.yaml
All checks were successful
Check with kubeconform / lint (push) Successful in 12s

This commit is contained in:
ab
2025-07-09 10:02:13 +00:00
parent 72a1154610
commit e4c86235ae

View File

@@ -1,4 +1,3 @@
---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
@@ -6,39 +5,22 @@ metadata:
namespace: minecraft namespace: minecraft
data: data:
nginx.conf: | nginx.conf: |
# Запуск рабочих процессов от имени пользователя nginx
user nginx; user nginx;
# Рекомендуется ставить worker_processes auto; но 1 тоже будет работать
worker_processes 1; worker_processes 1;
error_log /var/log/nginx/error.log warn; # Added for easier debugging
pid /var/run/nginx.pid;
events { events {
worker_connections 1024; worker_connections 1024;
} }
http { http {
# --- ИСПРАВЛЕНИЯ И ОПТИМИЗАЦИЯ --- include /etc/nginx/mime.types; # Use standard MIME types
# Включаем sendfile для быстрой отдачи файлов напрямую из файловой системы
sendfile on;
tcp_nopush on;
# --- КОНЕЦ ИСПРАВЛЕНИЙ ---
# Определяем MIME-типы файлов, чтобы браузер знал, как их обрабатывать
types {
application/zip zip;
text/html html htm;
text/css css;
application/javascript js;
image/png png;
image/jpeg jpg jpeg;
}
# Тип по умолчанию для всех остальных файлов
default_type application/octet-stream; default_type application/octet-stream;
server { server {
listen 80; listen 80;
# Этот блок остается без изменений для вашего основного сайта
location / { location / {
proxy_pass http://localhost:8123; proxy_pass http://localhost:8123;
sub_filter 'Minecraft Dynamic Map' "Hexor's MC server"; sub_filter 'Minecraft Dynamic Map' "Hexor's MC server";
@@ -46,19 +28,23 @@ data:
sub_filter_once off; sub_filter_once off;
} }
# --- УПРОЩЕННЫЙ БЛОК ДЛЯ СКАЧИВАНИЯ ФАЙЛОВ --- # --- CORRECTED BLOCK FOR FILE DOWNLOADS ---
# Этот блок теперь корректно и эффективно обрабатывает все файлы в /clients/
location /clients/ { location /clients/ {
# Указываем реальный путь к файлам на сервере # Path on the server where your files are stored
alias /mc/clients/; alias /mc/clients/;
# Показывает список файлов, если запрошена сама директория # Enable efficient file transfer
autoindex on; sendfile on;
# Tell the browser to download the file instead of opening it
add_header Content-Disposition "attachment"; add_header Content-Disposition "attachment";
# (Optional) Show a file listing if a directory is requested
autoindex on;
} }
} }
} }
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment