Update k8s/games/minecraft/deployments.yaml
All checks were successful
Check with kubeconform / lint (push) Successful in 12s
All checks were successful
Check with kubeconform / lint (push) Successful in 12s
This commit is contained in:
@@ -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/;
|
||||
|
||||
# Показывает список файлов, если запрошена сама директория
|
||||
autoindex on;
|
||||
|
||||
add_header Content-Disposition "attachment";
|
||||
# Path on the server where your files are stored
|
||||
alias /mc/clients/;
|
||||
|
||||
# Enable efficient file transfer
|
||||
sendfile on;
|
||||
|
||||
# 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
|
||||
|
Reference in New Issue
Block a user