·4 min read
“Pterodactyl is an open-source game server management panel built with PHP 7, 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.” — https://pterodactyl.io
A common issue/question I see happening frequently is running Pterodactyl behind a Cloudflare Proxy. Cloudflare will not only protect your instances IP address from the public- it is an added security benefit. In addition confusion is added when the community has no direction on how todo it — this should be documented.
This documentation is designed for a Pterodactyl front-end running Nginx as the webserver.
Before continuing, please make sure you’ve setup Cloudflare and have your nameservers set.
2. Creating origin certificates. Visit SSL -> Origin Certificates- click create certificate. Leave settings as is, click create.
3. Copy your Origin AND private key to a safe place for now.
4. Once copied and stored safely, move on.
Before moving on; verify that proxy is enabled for the domain under the DNS tab.
Once you’ve saved the file- you can restart your nginx server.
systemctl restart nginx
Your Pterodactyl panel is now behind a proxy! Please note: If you have the same FQDN for your node & frontend, you will need to follow the additional steps below.
Edit Jan 6, 2022:
It is recommended that you make the following configuration edits to your .env & nginx configurations.
In your pterodactyl nginx configuration.
Locate the following section:
Paste the following from the pterodactyl website under the server block:
[
pterodactyl.io
](https://pterodactyl.io/panel/1.0/additional_configuration.html#nginx-specific-configuration)
After, you need to edit your .env file located in /var/www/pterodactyl. Place the following line anywhere in that file.
[
pterodactyl.io
](https://pterodactyl.io/panel/1.0/additional_configuration.html#cloudflare-specific-configuration)
Restart nginx using systemctl restart nginx.
Please make sure you’ve followed the steps above to generate your certificates and verify your pterodactyl frontend is working.
Save your file, please make sure “Behind proxy” is not enabled on your daemon. You can now reboot your wings. systemctl restart wings
You’ve now successfully installed, setup, and configured your Pterodactyl instance for Cloudflare’s proxy!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Tenetur vero esse non molestias eos excepturi, inventore atque cupiditate.