xcode75 / XManagerPlus

An Xray Manager
https://xcode75.github.io/XMPlusDocs/
255 stars 47 forks source link

[BUG] #308

Closed sohrabp72 closed 7 months ago

sohrabp72 commented 7 months ago

Environment

OS: AlmaLinux 8.8 (Sapphire Caracal)

PHP version:

DB version:

Panel Version: XMPlus 1.0 - v20231107

Debug Info: enable debug in config.php and upload screenshot.

Bug Info

Describe the issue you run into.。 even though there is a guide https://github.com/xcode75/XManagerPlus/issues/56 I still can't get Nginx + CDN [ WS(TLS) / GRPC (TLS) ] working, is there any step by step simple guide? what I did:

  1. on my backend server which is different than my frontend server, I installed nginx with the cdn.conf file:

    server {
    listen 8080;
    listen [::]:8080;
    server_name  faxxxxxx.sxx; #My domain
    index index.html;
    root /var/www/html;
    
    set_real_ip_from 103.21.244.0/22;
    set_real_ip_from 103.22.200.0/22;
    set_real_ip_from 103.31.4.0/22;
    set_real_ip_from 104.16.0.0/12;
    set_real_ip_from 108.162.192.0/18;
    set_real_ip_from 131.0.72.0/22;
    set_real_ip_from 141.101.64.0/18;
    set_real_ip_from 162.158.0.0/15;
    set_real_ip_from 172.64.0.0/13;
    set_real_ip_from 173.245.48.0/20;
    set_real_ip_from 188.114.96.0/20;
    set_real_ip_from 190.93.240.0/20;
    set_real_ip_from 197.234.240.0/22;
    set_real_ip_from 198.41.128.0/17;
    set_real_ip_from 2400:cb00::/32;
    set_real_ip_from 2606:4700::/32;
    set_real_ip_from 2803:f800::/32;
    set_real_ip_from 2405:b500::/32;
    set_real_ip_from 2405:8100::/32;
    set_real_ip_from 2c0f:f248::/32;
    set_real_ip_from 2a06:98c0::/29;
    
    real_ip_header CF-Connecting-IP;    
    
    location xmplus { #Your server GRPC ServiceName
        if ($content_type !~ "application/grpc") {
            return 404;
        }
        client_max_body_size 0;
        client_body_timeout 60m;
        send_timeout 60m;
        lingering_close always;
    
        grpc_read_timeout 3m;
        grpc_send_timeout 2m;
        grpc_set_header Host $host;
        grpc_set_header X-Real-IP $remote_addr;
        grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        grpc_pass grpc://127.0.0.1:2095;   #grpc_pass grpc://127.0.0.1:5500
    }
    
    #location / Your server Websocket Path {  #Your server Websocket Path
    #    if ($http_upgrade != "websocket") {
    #        return 404;
    #    }
    #    proxy_redirect off;
    #    proxy_pass http://127.0.0.1:Your XMPlus Listening Port; #proxy_pass http://127.0.0.1:5500
    #    proxy_http_version 1.1;
    #    proxy_set_header Upgrade $http_upgrade;
    #    proxy_set_header Connection "upgrade";
    #    proxy_set_header Host $host;
    #    proxy_set_header X-Real-IP $remote_addr;
    #    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #}     
    }
  2. Setup a server on XMplus frontend panel as follows: Untitled Untissdtled

but this node does not work, some useful info would be: The domain in the cdn.conf file is not proxied by CloudFlare, it is "DNS only"