Add new server
This commit is contained in:
parent
b8e99abd92
commit
6048933394
3 changed files with 49 additions and 3 deletions
14
configs/nginx/proxy-vpn.nginx
Normal file
14
configs/nginx/proxy-vpn.nginx
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
stream {
|
||||||
|
upstream vless_backend {
|
||||||
|
server vpn.spectralvpn.ru:442;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 442 reuseport;
|
||||||
|
listen [::]:442 reuseport;
|
||||||
|
proxy_pass vless_backend;
|
||||||
|
proxy_protocol on;
|
||||||
|
proxy_timeout 30s;
|
||||||
|
proxy_connect_timeout 10s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
server {
|
server {
|
||||||
listen 8500 ssl;
|
listen 8500 ssl;
|
||||||
listen [::]:8500 ssl;
|
listen [::]:8500 ssl;
|
||||||
server_name spectralvpn.ru;
|
server_name vpn.spectralvpn.ru;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/spectralvpn.ru/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/vpn.spectralvpn.ru/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/spectralvpn.ru/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/vpn.spectralvpn.ru/privkey.pem;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
if ($request_method = 'OPTIONS') {
|
if ($request_method = 'OPTIONS') {
|
||||||
add_header 'Access-Control-Allow-Origin' 'https://spectralvpn.ru';
|
add_header 'Access-Control-Allow-Origin' 'https://spectralvpn.ru';
|
||||||
|
add_header 'Access-Control-Allow-Origin' 'https://vpn.spectralvpn.ru';
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, OPTIONS';
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, OPTIONS';
|
||||||
add_header 'Access-Control-Allow-Headers' 'Content-Type';
|
add_header 'Access-Control-Allow-Headers' 'Content-Type';
|
||||||
add_header 'Access-Control-Max-Age' 86400;
|
add_header 'Access-Control-Max-Age' 86400;
|
||||||
|
|
@ -24,5 +25,6 @@ server {
|
||||||
proxy_set_header X-Forwarded-Port $server_port;
|
proxy_set_header X-Forwarded-Port $server_port;
|
||||||
|
|
||||||
add_header Access-Control-Allow-Origin "https://spectralvpn.ru" always;
|
add_header Access-Control-Allow-Origin "https://spectralvpn.ru" always;
|
||||||
|
add_header Access-Control-Allow-Origin "https://vpn.spectralvpn.ru" always;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
30
configs/nginx/spectralvpn_api_proxy.nginx
Normal file
30
configs/nginx/spectralvpn_api_proxy.nginx
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
server {
|
||||||
|
listen 8500 ssl;
|
||||||
|
listen [::]:8500 ssl;
|
||||||
|
server_name spectralvpn.ru;
|
||||||
|
|
||||||
|
ssl_certificate /etc/letsencrypt/live/spectralvpn.ru/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/spectralvpn.ru/privkey.pem;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
|
add_header 'Access-Control-Allow-Origin' 'https://spectralvpn.ru';
|
||||||
|
add_header 'Access-Control-Allow-Origin' 'https://vpn.spectralvpn.ru';
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, OPTIONS';
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'Content-Type';
|
||||||
|
add_header 'Access-Control-Max-Age' 86400;
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy_pass https://vpn.spectralvpn.ru:8500;
|
||||||
|
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_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-Port $server_port;
|
||||||
|
|
||||||
|
add_header Access-Control-Allow-Origin "https://spectralvpn.ru" always;
|
||||||
|
add_header Access-Control-Allow-Origin "https://vpn.spectralvpn.ru" always;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue