Pterodactyl Panel proxied through Cloudflare

I'm trying to Proxy Pterodactyl Panel through Cloudflare and I have created Origin Certificates from CF and configured them into my Panel. Now when I try to go to my panel it "stalls" and just doesn't load anything, like in the picture. Btw I've following this tutorial https://www.youtube.com/watch?v=yOG45TLWNu0&t=436s.
No description
148 Replies
Chaika
Chaikaā€¢10mo ago
ctrl+shift+i or right click -> inspect and look at the console/network tabs and see which requests are failing I haven't played around to much with pterodactyl but iirc it uses "Wings" on the host server for status/actual server info which its probably trying to send requests to and failing
Toffi
ToffiOPā€¢10mo ago
Ah yes request I forgot that, it's 504
Object { message: "Request failed with status code 504", name: "AxiosError", code: "ERR_BAD_RESPONSE", config: {ā€¦}, request: XMLHttpRequest, response: {ā€¦}, stack: "" }
Object { message: "Request failed with status code 504", name: "AxiosError", code: "ERR_BAD_RESPONSE", config: {ā€¦}, request: XMLHttpRequest, response: {ā€¦}, stack: "" }
Chaika
Chaikaā€¢10mo ago
that's the request for server info? Any more info on it? What's the request path and such?
Toffi
ToffiOPā€¢10mo ago
there's also this
No description
Chaika
Chaikaā€¢10mo ago
That error looks like your panel is trying to reach out to wings/the actual server via Axios and failing, I would check config/logs
Toffi
ToffiOPā€¢10mo ago
No description
Toffi
ToffiOPā€¢10mo ago
Oh, I think I haven't opened daemon port 8443 Let me check Wasn't, but now is It's still in same condition however I rebooted also
Chaika
Chaikaā€¢10mo ago
Did the error change at all? For me that gives an instant 523 now Err maybe you were rebooting it when i was testing, seems to back to timeout now
Toffi
ToffiOPā€¢10mo ago
nope yeah ig
ubuntu@oracle:~$ tail -n 1000 /var/www/pterodactyl/storage/logs/laravel-$(date +%F).log | grep "\[$(date +%Y)"
[2024-02-06 18:41:35] production.WARNING: GuzzleHttp\Exception\ServerException: Server error: `GET https://panel.1stclub.xyz:8443/api/servers/79d87146-e5a7-4084-be41-d0272755ce71` resulted in a `523 ` response:
ubuntu@oracle:~$ tail -n 1000 /var/www/pterodactyl/storage/logs/laravel-$(date +%F).log | grep "\[$(date +%Y)"
[2024-02-06 18:41:35] production.WARNING: GuzzleHttp\Exception\ServerException: Server error: `GET https://panel.1stclub.xyz:8443/api/servers/79d87146-e5a7-4084-be41-d0272755ce71` resulted in a `523 ` response:
here are the logs any idea? by that
Chaika
Chaikaā€¢10mo ago
So my understanding is Wings is on 8443 but it's unreachable. Panel is on 443 and works fine. Check Wings config/anything blocking it. On the server itself can you reach that port? curl https://127.0.0.1:8443 -k -vvv
Toffi
ToffiOPā€¢10mo ago
Yep connection refuse for 8443
Chaika
Chaikaā€¢10mo ago
I guess by default it's on 8080 and you need to change it? https://pterodactyl.io/wings/1.0/configuration.html#enabling-cloudflare-proxy
Additional Configuration | Pterodactyl
Pterodactyl is an open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
Toffi
ToffiOPā€¢10mo ago
Yes, but if I want to use proxy I need to use 8443
Chaika
Chaikaā€¢10mo ago
Right, so I'm guessing you didn't change it or something went wrong in that changing process
Toffi
ToffiOPā€¢10mo ago
I did change it on conf
Toffi
ToffiOPā€¢10mo ago
No description
Toffi
ToffiOPā€¢10mo ago
Your panel is not up-to-date! The latest version is 1.11.5 and you are currently running version 1.11.3.
Your panel is not up-to-date! The latest version is 1.11.5 and you are currently running version 1.11.3.
Could this also affect this? Tho I have updated panel twice without single error, but it stays 'outdated'...
debargha
debarghaā€¢10mo ago
no
Toffi
ToffiOPā€¢10mo ago
alright then
debargha
debarghaā€¢10mo ago
is your panel and wings on the same machine?
Toffi
ToffiOPā€¢10mo ago
yes
debargha
debarghaā€¢10mo ago
try running sudo wings --debug make sure to stop the old and see the logs
Toffi
ToffiOPā€¢10mo ago
DEBUG: [Feb 6 17:19:46.651] making request to external HTTP endpoint endpoint=https://panel.1stclub.xyz/api/remote/servers?page=0&per_page=50 headers=map[Accept:[application/vnd.pterodactyl.v1+json] Authorization:[(redacted)] Content-Type:[application/json] User-Agent:[Pterodactyl Wings/v1.11.8 (id:uRcSmQ8hRbj2R3LZ)]] method=GET
FATAL: [Feb 6 17:19:46.689] failed to load server configurations error=manager: failed to retrieve server configurations: Error response from Panel: AccessDeniedHttpException: You are not authorized to access this resource. (HTTP/403)
DEBUG: [Feb 6 17:19:46.651] making request to external HTTP endpoint endpoint=https://panel.1stclub.xyz/api/remote/servers?page=0&per_page=50 headers=map[Accept:[application/vnd.pterodactyl.v1+json] Authorization:[(redacted)] Content-Type:[application/json] User-Agent:[Pterodactyl Wings/v1.11.8 (id:uRcSmQ8hRbj2R3LZ)]] method=GET
FATAL: [Feb 6 17:19:46.689] failed to load server configurations error=manager: failed to retrieve server configurations: Error response from Panel: AccessDeniedHttpException: You are not authorized to access this resource. (HTTP/403)
debargha
debarghaā€¢10mo ago
is your node proxied?
Toffi
ToffiOPā€¢10mo ago
not right now im trying with out
debargha
debarghaā€¢10mo ago
do you have waf enabled?
Toffi
ToffiOPā€¢10mo ago
whats that?
debargha
debarghaā€¢10mo ago
or maybe im under attack mode etc also, is your port open?
Toffi
ToffiOPā€¢10mo ago
on https://dnschecker.org/ it says closed...
DNS Checker
DNS Checker - DNS Check Propagation Tool
Check DNS Propagation worldwide. DNS Checker provides name server propagation check instantly. Changed nameservers so do a DNS lookup and check if DNS and nameservers have propagated.
Toffi
ToffiOPā€¢10mo ago
for 8080
debargha
debarghaā€¢10mo ago
arent you using 8443? also it will say closed if your service isnt running you should check it in your vps
Toffi
ToffiOPā€¢10mo ago
yes for protected, but im now trying to make it work without proxy protection on vps 8080 and 8443 is opened
debargha
debarghaā€¢10mo ago
so have you edited the /etc/pterodactyl/config.yml right?
Toffi
ToffiOPā€¢10mo ago
yeah
debargha
debarghaā€¢10mo ago
in your oracle networking too?
Toffi
ToffiOPā€¢10mo ago
wdym?
debargha
debarghaā€¢10mo ago
are you using oracle vps?
Toffi
ToffiOPā€¢10mo ago
yes
debargha
debarghaā€¢10mo ago
so you have to also open the ports there
Toffi
ToffiOPā€¢10mo ago
yeah they're open
debargha
debarghaā€¢10mo ago
in oracle?
Toffi
ToffiOPā€¢10mo ago
yep
Toffi
ToffiOPā€¢10mo ago
wings status
No description
debargha
debarghaā€¢10mo ago
regenerate the token from your panel and paste it
Toffi
ToffiOPā€¢10mo ago
Daemon Master Key ?
debargha
debarghaā€¢10mo ago
no in configuration
Toffi
ToffiOPā€¢10mo ago
Hmm, now the site gives 523 straight away
debargha
debarghaā€¢10mo ago
panel?
Toffi
ToffiOPā€¢10mo ago
yes when I try to reach now it reached but still doesn't work properly
Toffi
ToffiOPā€¢10mo ago
No description
debargha
debarghaā€¢10mo ago
logs? sudo wings diagnostics
debargha
debarghaā€¢10mo ago
wings --debug ok you have a firewall issue
Toffi
ToffiOPā€¢10mo ago
alright, hmm
debargha
debarghaā€¢10mo ago
your wings ip is blocked by panel cloudflare go to cloudflare > security > waf then add rule ip source address equals yout wings ip
Toffi
ToffiOPā€¢10mo ago
wings ip = ?
debargha
debarghaā€¢10mo ago
then choose action skip Wings ip is your public oracle ip if your panel and wings same machine then sane ip yhis will 101% work
Toffi
ToffiOPā€¢10mo ago
oh yeah.. ?
No description
debargha
debarghaā€¢10mo ago
yes select everything everything possible
Chaika
Chaikaā€¢10mo ago
If you think it's blocking it, you should check under Security -> events first if you can even see it
debargha
debarghaā€¢10mo ago
yes
Chaika
Chaikaā€¢10mo ago
there's some products that aren't skippable
debargha
debarghaā€¢10mo ago
supah bot fight
Toffi
ToffiOPā€¢10mo ago
No firewall events found matching your filters
debargha
debarghaā€¢10mo ago
what filter you add? wings ip?
Toffi
ToffiOPā€¢10mo ago
Nothing
debargha
debarghaā€¢10mo ago
oh
Chaika
Chaikaā€¢10mo ago
you disabled proxy for the panel subdomain, looks like?
Toffi
ToffiOPā€¢10mo ago
yes, I'm trying without proxy temporary I will try to configure the proxy some day
debargha
debarghaā€¢10mo ago
oh your panel isnt proxied šŸ’€ You regenerated your token righr? you overwrited the file too right?
Toffi
ToffiOPā€¢10mo ago
I dont think the error was from firewall I regened the token and it worked then but anyway
debargha
debarghaā€¢10mo ago
No it isn't i thought ur panel is proxied
Toffi
ToffiOPā€¢10mo ago
yep ofc
debargha
debarghaā€¢10mo ago
like it worked? green heart too?
Toffi
ToffiOPā€¢10mo ago
yeah
debargha
debarghaā€¢10mo ago
then maybe reset the daemon key, save it, then again regenerate token
Toffi
ToffiOPā€¢10mo ago
why again? it's works now
debargha
debarghaā€¢10mo ago
after resetting the daemo n key?
Toffi
ToffiOPā€¢10mo ago
yes I resetted that and also conf key
debargha
debarghaā€¢10mo ago
hm that was the issue ok nvm also dont proxy nodes if you are gonna use minecraft server, it won't connect then you can proxy the panel
Toffi
ToffiOPā€¢10mo ago
I meant to proxy the panel, not wings
debargha
debarghaā€¢10mo ago
oh then you dont have to use 8443
Toffi
ToffiOPā€¢10mo ago
Isn't there a solution to proxy wings? iirc
debargha
debarghaā€¢10mo ago
see you can but minecraft won't work (coz i have only tested that) maybe because minecraft tries to connect to the cloudflare ip
Toffi
ToffiOPā€¢10mo ago
aight
debargha
debarghaā€¢10mo ago
is there any solution tho @Chaika
Chaika
Chaikaā€¢10mo ago
solution for what, I wasn't following? proxying minecraft?
debargha
debarghaā€¢10mo ago
yes
Chaika
Chaikaā€¢10mo ago
Cloudflare Spectrum but it's stupid expensive ($1/gb) out of an Enterprise Contract or Magic Transit but it's fully Enterprise
debargha
debarghaā€¢10mo ago
oh
Toffi
ToffiOPā€¢10mo ago
Aalright I see, so with Cloudflare's proxy I can't protect Pterodactyl right?
debargha
debarghaā€¢10mo ago
you can protect panel...
Toffi
ToffiOPā€¢10mo ago
yes, I meant the servers
debargha
debarghaā€¢10mo ago
oh maybe others games may work i dont know much about networking lol
Toffi
ToffiOPā€¢10mo ago
alright
Chaika
Chaikaā€¢10mo ago
cf's normal proxy is just http/https unless the game is a http powered game then won't work with normal proxy lol
Toffi
ToffiOPā€¢10mo ago
yeah lol
debargha
debarghaā€¢10mo ago
lol
Toffi
ToffiOPā€¢10mo ago
SuperKali
YouTube
HOW TO PROTECT YOUR PTERODACTYL PANEL WITH CLOUDFLARE PROXY
Hi guys, today I will show you how to protect your server against DDoS attacks through Cloudflare, in the next video, I will show how to add new nodes on the pterodactyl panel! šŸ”’ This tutorial requires a Domain and VPS (KVM & VMware) šŸ”§ I need support, can contact you for some help? āž”ļø Yes, you can contact me through my email or discord, some f...
Toffi
ToffiOPā€¢10mo ago
So this was the tutorial I was following And he put 8443 as the port of daemon
debargha
debarghaā€¢10mo ago
3 yo old video, things may have changed altough not sure...
Toffi
ToffiOPā€¢10mo ago
I think it's pretty similar but shouldn't the panel still work if I put 8443 as daemon port? bcz it shut here
debargha
debarghaā€¢10mo ago
yes, any unique port will work until port is opened, that error was due to invalid token/key
Toffi
ToffiOPā€¢10mo ago
hmm, what could have cause that?
debargha
debarghaā€¢10mo ago
maybe you accidently edited the key in the config.yml while changing port maybe some letter got put, etc.
Toffi
ToffiOPā€¢10mo ago
oh right yeah Now that I know that, I also cant proxy the panel, cause wings has same IP and so minecraft & servers, right?
debargha
debarghaā€¢10mo ago
no you obviously can, and you should to protect from ddos aatacks, just use a different domain for the node
Toffi
ToffiOPā€¢10mo ago
So I would need to delete my current node and make a new one w/ diff subdomain
debargha
debarghaā€¢10mo ago
no no, you can switch subdomains too, no need to delete annything at all
debargha
debarghaā€¢10mo ago
ignore daemon
Toffi
ToffiOPā€¢10mo ago
Oh oh okay great
Stacktrace:
Get "https://panel.1stclub.xyz/api/remote/servers?page=0&per_page=50": tls: failed to verify certificate: x509: certificate signed by unknown authority
http: request creation failed
Stacktrace:
Get "https://panel.1stclub.xyz/api/remote/servers?page=0&per_page=50": tls: failed to verify certificate: x509: certificate signed by unknown authority
http: request creation failed
I'm trying to proxy it now, but cloudflare certificate "signed by unkown authority"? @debargha ?
debargha
debarghaā€¢10mo ago
maybe some issue go to ur cloudflare > ssl/tls > set cert to max setting
Toffi
ToffiOPā€¢10mo ago
oh yes it was by cf side, now the ssl works, BUT my panel (wings) stoppped work :/ I fixed that^ and set wings port to 8443 and sftp to 2053 and everything seems to work as they should but wings still not working on panel? Gives 504 error again
http: TLS handshake error from :52424: local error: tls: bad record MAC
http: TLS handshake error from :52424: local error: tls: bad record MAC
Toffi
ToffiOPā€¢10mo ago
sometimes the wings is ok, but sometimes it goes down...
No description
Toffi
ToffiOPā€¢10mo ago
@debargha do you have any idea?
debargha
debarghaā€¢10mo ago
how do you run wings?
Toffi
ToffiOPā€¢10mo ago
systemctl start/restart wings and sudo wings (--debug) but there's something with the certificate currently it's valid but somethings not working I also do get ssh error..?
sftp: failed to accept inbound connection error=ssh: no common algorithm for key exchange; client offered: [diffie-hellman-group-exchange-sha25
sftp: failed to accept inbound connection error=ssh: no common algorithm for key exchange; client offered: [diffie-hellman-group-exchange-sha25
so, I still havent figured out.. @debargha @Chaika
Toffi
ToffiOPā€¢10mo ago
it's strange that panel shows green heart
No description
Toffi
ToffiOPā€¢10mo ago
http: TLS handshake error from :49416: local error: tls: bad record MAC
http: TLS handshake error from :49416: local error: tls: bad record MAC
something with sftp it seems to be
debargha
debarghaā€¢10mo ago
when you click on that node, oracle cloud, are the information showing or loading forever
Toffi
ToffiOPā€¢10mo ago
loading forever the wings/panel is working like half console shows, but not files.. it's strange 504 is the error code
debargha
debarghaā€¢10mo ago
that means your browser can connect to winga but your panel can't thats because your panel isnt connected to wings First of all I hope you didn't proxy the node.
Toffi
ToffiOPā€¢10mo ago
I proxied panel
debargha
debarghaā€¢10mo ago
then don't use 8443 port yes its fine
Toffi
ToffiOPā€¢10mo ago
I dont
debargha
debarghaā€¢10mo ago
You are using 8080 then?
Toffi
ToffiOPā€¢10mo ago
yep
Toffi
ToffiOPā€¢10mo ago
No description
debargha
debarghaā€¢10mo ago
Ok thats the issue You should use lets encrypt cert for wings is that one from cloudflare?
Toffi
ToffiOPā€¢10mo ago
yeah it is full strict
debargha
debarghaā€¢10mo ago
Cloudflare cert is only valid when you use cloudflare So use certbot for wings
Toffi
ToffiOPā€¢10mo ago
Oh yeah ofc
debargha
debarghaā€¢10mo ago
because your wings isnt using cloudflare
Toffi
ToffiOPā€¢10mo ago
yeah
debargha
debarghaā€¢10mo ago
so run certbot certonly then gen cert fpr you wings node then again go to config.yml and change the path to that ssl and then restart and u done
Toffi
ToffiOPā€¢10mo ago
How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Nginx Web Server plugin (nginx)
2: Spin up a temporary webserver (standalone)
3: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Nginx Web Server plugin (nginx)
2: Spin up a temporary webserver (standalone)
3: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Do I use nginx one? @debargha
ssh: no common algorithm for key exchange; client offered:
ssh: no common algorithm for key exchange; client offered:
The certificate seems to work now, but now I get this and my wings still goes down.. @debargha That's for sftp, but I think my server runs good now
debargha
debarghaā€¢10mo ago
yes
Toffi
ToffiOPā€¢10mo ago
service wings status
No description
debargha
debarghaā€¢10mo ago
what os are you using
Toffi
ToffiOPā€¢10mo ago
vps or my pc
debargha
debarghaā€¢10mo ago
run systemd-detect-virt
Toffi
ToffiOPā€¢10mo ago
kvm
debargha
debarghaā€¢10mo ago
thats good
Toffi
ToffiOPā€¢10mo ago
it seems to work now though
debargha
debarghaā€¢10mo ago
ohk
Toffi
ToffiOPā€¢10mo ago
tysm I will say if something goes wrong again:D
debargha
debarghaā€¢10mo ago
sure wlcm
Want results from more Discord servers?
Add your server