Check Methods
Advanced Configuration
Custom IP Check Services
You can use alternative IP check services (see check methods for details):
http://ip.sb
https://api64.ipify.org
http://ifconfig.me
Example:
PROXY_IP_CHECK_URL=http://ip.sb
Custom Status Check URLs
Alternative URLs for status checking (see check methods for details):
http://www.gstatic.com/generate_204
http://www.qualcomm.cn/generate_204
http://cp.cloudflare.com/generate_204
Example:
PROXY_STATUS_CHECK_URL=http://www.gstatic.com/generate_204
Security Configuration
Enable authentication for sensitive endpoints:
METRICS_PROTECTED=trueMETRICS_USERNAME=custom_userMETRICS_PASSWORD=secure_password
Instance Labeling
Add instance labels for distributed setups:
METRICS_INSTANCE=datacenter-1
Update Intervals
Customize check and update intervals:
# Check every minutePROXY_CHECK_INTERVAL=60
# Update subscription every hourSUBSCRIPTION_UPDATE_INTERVAL=3600
Logging Configuration
Adjust Xray Core logging:
# Enable debug loggingXRAY_LOG_LEVEL=debug
# Disable loggingXRAY_LOG_LEVEL=none
Port Configuration
Customize port ranges:
# Start SOCKS5 ports from 20000XRAY_START_PORT=20000
# Change metrics portMETRICS_PORT=9090
Configuration for steal-from-yourself domain
You have your own domain, your-domain.com, with a website running on it,
and you want to display monitoring at your-domain.com/xray/monitor
.
Run Xray Checker on the same server where your website is hosted.
The parameter -p 127.0.0.1:2112:2112
ensures that direct access
to it is only possible from the server itself:
docker run -d \ -e SUBSCRIPTION_URL=https://your-subscription-url/sub \ -p 127.0.0.1:2112:2112 \ -e METRICS_BASE_PATH=/xray/monitor \ -e METRICS_PROTECTED=true \ -e METRICS_USERNAME=custom_user \ -e METRICS_PASSWORD=custom_pass \ kutovoys/xray-checker
Open nginx configuration file (sudo nano /etc/nginx/your-domain.com
), find main section:
server { root /var/www/your-domain.com/html;
index index.html; server_name your-stealing-domain.com; ...}
and paste there 3 new locations:
# Handle /xray/monitor without a trailing slash location = /xray/monitor { return 301 https://$host$request_uri/; }
# Handle /xray/monitor/ - redirect to xray checker's docker port location /xray/monitor/ { proxy_pass http://127.0.0.1:2112/xray/monitor/; 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; }
then check and reload nginx:
sudo nginx -tsudo systemctl reload nginx
and check availability of monitoring:
curl -I -L https://your-domain.com/xray/monitor