Last active
April 15, 2026 17:42
-
-
Save TheDevFreak/94b702f4c802fd76e41880ef1da3d9e7 to your computer and use it in GitHub Desktop.
Pterodactyl Panel Behind an NGINX Reverse Proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Your panel should run on port 80 (well whatever you want I suppose) | |
| Node daemon port should be 443 (but still http) because it hard codes those ports into connection urls for websockets in the webui :/ | |
| Ensure you have `TRUSTED_PROXIES=proxyip` in your `/var/www/pterodactyl/.env` file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 443 ssl; | |
| ssl on; | |
| ssl_certificate /path/to/cert/fullchain.pem; | |
| ssl_certificate_key /path/to/cert/key.pem; | |
| server_name panel.domain.tld; | |
| location / { | |
| proxy_pass http://PANELIP_should_be_port_80/; | |
| proxy_set_header Host $host; | |
| client_max_body_size 50m; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Forwarded-Proto $scheme; | |
| proxy_redirect off; | |
| proxy_buffering off; | |
| proxy_request_buffering off; | |
| } | |
| } | |
| server { | |
| listen 443 ssl; | |
| ssl on; | |
| ssl_certificate /path/to/cert/fullchain.pem; | |
| ssl_certificate_key /path/to/cert/key.pem; | |
| server_name node1.domain.tld; | |
| location ~ ^\/api\/servers\/(?<serverid>.*)?\/ws$ { | |
| proxy_pass http://node_ip:443/api/servers/$serverid/ws; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_set_header Host $host; | |
| client_max_body_size 50m; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-Proto $scheme; | |
| proxy_redirect off; | |
| proxy_buffering off; | |
| proxy_request_buffering off; | |
| } | |
| location / { | |
| proxy_pass http://node_ip:443/; | |
| proxy_set_header Host $host; | |
| client_max_body_size 50m; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-Proto $scheme; | |
| proxy_redirect off; | |
| proxy_buffering off; | |
| proxy_request_buffering off; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can't get Pterodactyl to work behind Nginx Proxy Manager either.
My setup
Domain with @ and * records linked to the VPS IP address
VPS (Proxmox)
Virtual bridge 192.168.111.1/24
UFW on the PVE
UFW Allow Ports 8082/TCP 2022/TCP 25585/TCP 25585/UDP
UFW Forward
LXC-110-Debian13 (IP 192.168.111.110):
Docker + Nginx Proxy Manager
2 proxy hosts: ptero.domain.tld + node1.domain.tld
Scheme http / Port 80 / WebSocket on / SSL cert / SSL on / HTTP/2 on
LXC-202-Debian13 (IP 192.168.111.202):
Pterodactyl Panel + Wing
Application URL in Panel setup: ptero.domain.tld
.env TRUSTED_PROXIES=* added
Web Server Nginx Without SSL replaces server_name with ptero.domain.tld
Wing setup: FQDN node1.domain.tld, SSL Connection, Behind Proxy, Daemon Port 443, SFTP Port 2022
I copied the cert and key from LXC-110 to LXC-202
In config.yml I changed:
host: 192.168.111.202
port: 443
cert: /etc/pterodactyl/fullchain.pem
key: /etc/pterodactyl/privkey.pem
remote: 'https://ptero.domain.tld'
I added the entry in the proxy host for the panel (ptero.domain.tld) under “Advanced”:
I added the following entry in the proxy host for the node (node1.domain.tld):
When I start Wing, I get the following error message
I have no idea what I'm doing wrong :(
I have updated the domain and the VPS IP in the post. These are correct in the live system.