server {
listen 80;
server_name api.example.ru;
location / {
return 301 https://api.example.ru$request_uri;
}
}
server {
listen 443 ssl;
server_name api.example.ru;
ssl_certificate /var/lib/marzban/certs/fullchain.pem;
ssl_certificate_key /var/lib/marzban/certs/key.pem;
location /marzban {
alias /dashboard;
}
}
server {
listen 80;
server_name 147.45.40.50;
location / {
return 301 https://api.vpn.online$request_uri;
}
}
server {
listen 443 ssl;
server_name 147.45.40.50;
ssl_certificate /var/lib/marzban/certs/fullchain.pem;
ssl_certificate_key /var/lib/marzban/certs/key.pem;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect default;
}
location /phpmyadmin/ {
proxy_pass http://127.0.0.1:8010/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect default;
}
}