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