создайте файл с к рприеру site.ru.conf
в папке /etc/nginx/sites-enabled
в него вставляем
server {
listen 80;
server_name yourdomain.com; # Замените на Ваш домен
location /marzban {
proxy_pass http://localhost:8000; # Прокси на Marzban
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /bot {
proxy_pass http://localhost:9000; # Прокси на Telegram-бота
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
error_page 404 /404.html; # Обработка ошибок
location = /404.html {
internal;
}
}
закрываем
выполняем проверку
nginx -t
если все ок рестартуем.
Опять же тут не показан https а он скорее всего будет нужен, возмоно у вас разные домены и тд и тп, но как частный случай при обращению
site.ru/marzban - будет один
site.ru/bot - так будет отображаться другой