Один последовательный гайд для схемы:
client -> Yandex Cloud CDN -> RU origin nginx -> 3xUI/Xray inbound 127.0.0.1:9001 -> internet
Порт 9001 наружу не открывается. Клиент подключается только к CDN-домену на 443.
Настроим VLESS + XHTTP через VK Cloud CDN с панелью 3x-ui на зарубежном VPS. На том же сервере будут работать Nginx, сайт-заглушка и Xray. Выход в интернет будет напрямую с этого VPS.
VPN-клиент
-> HTTPS, images-cdn.example.com:443, VK Cloud CDN
-> HTTPS, images.example.com:443, Nginx на VPS
-> HTTP, 127.0.0.1:9001, Xray под управлением 3x-ui
-> Интернет
| image: java:8-jdk | |
| stages: | |
| - build | |
| - test | |
| - deploy | |
| before_script: | |
| # - echo `pwd` # debug | |
| # - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug |
| #!/bin/bash | |
| # Check before running, may need intervention | |
| # Pass in the following to the script, or hardcode it. | |
| # Uncomment if hardcoding input. | |
| BOOT_PARTITION="/dev/sdg1" | |
| DISK_1="ata-SanDisk_SDSSDXPS480G_152271401093" | |
| DISK_2="ata-SanDisk_SDSSDXPS480G_154501401266" | |
| POOL="vault" |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| Backup: | |
| docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
| Restore: | |
| cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| #!/bin/bash | |
| # Copyright (C) 2016 Arash Shams <https://github.com/Ara4Sh>. | |
| # | |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| #!/usr/bin/env bash | |
| # Step 1: Fill in EMAIL, TOKEN, DOMAIN and SUBDOMAIN. Your API token is here: https://www.cloudflare.com/a/account/my-account | |
| # Make sure the token is the Global token, or has these permissions: #zone:read, #dns_record:read, #dns_records:edit | |
| # Step 2: Create an A record on Cloudflare with the subdomain you chose | |
| # Step 3: Run "./ddns.sh -l" to get the zone_id and rec_id of the record you created. | |
| # Fill in ZONE_ID and REC_ID below | |
| # This step is optional, but will save you 2 requests every time you this script | |
| # Step 4: Run "./ddns.sh". It should tell you that record was updated or that it didn't need updating. | |
| # Step 5: Run it every hour with cron. Use the '-s' flag to silence normal output |
| acl from_cf src -f /etc/haproxy/cf-ips | |
| http-request set-src req.hdr(CF-Connecting-IP) if from_cf | |
| option forwardfor if-none |