mirror of
https://github.com/pterodactyl/documentation.git
synced 2025-12-10 10:44:43 -06:00
335 lines
34 KiB
HTML
335 lines
34 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en-US">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<title>Webserver Configuration | Pterodactyl</title>
|
||
<meta name="generator" content="VuePress 1.9.10">
|
||
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
||
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
|
||
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
|
||
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#0e4688">
|
||
<link rel="manifest" href="/favicons/site.webmanifest">
|
||
<link rel="shortcut icon" href="/favicons/favicon.ico">
|
||
<meta name="description" content="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.">
|
||
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
|
||
<meta name="theme-color" content="#0e4688">
|
||
|
||
<link rel="preload" href="/assets/css/0.styles.894cd3e9.css" as="style"><link rel="preload" href="/assets/js/app.322e86a5.js" as="script"><link rel="preload" href="/assets/js/4.0da8214b.js" as="script"><link rel="preload" href="/assets/js/2.638bc23b.js" as="script"><link rel="preload" href="/assets/js/64.c028aa01.js" as="script"><link rel="prefetch" href="/assets/js/1.364681bc.js"><link rel="prefetch" href="/assets/js/10.08b9c98e.js"><link rel="prefetch" href="/assets/js/11.d107c8b2.js"><link rel="prefetch" href="/assets/js/12.469af100.js"><link rel="prefetch" href="/assets/js/13.43a16fbd.js"><link rel="prefetch" href="/assets/js/14.65d10cad.js"><link rel="prefetch" href="/assets/js/15.c66c8d6e.js"><link rel="prefetch" href="/assets/js/16.80d778f6.js"><link rel="prefetch" href="/assets/js/17.aa66495a.js"><link rel="prefetch" href="/assets/js/18.57b733fd.js"><link rel="prefetch" href="/assets/js/19.ec92bd63.js"><link rel="prefetch" href="/assets/js/20.5c80f685.js"><link rel="prefetch" href="/assets/js/21.e2cfd57c.js"><link rel="prefetch" href="/assets/js/22.81755508.js"><link rel="prefetch" href="/assets/js/23.4a3e5e0b.js"><link rel="prefetch" href="/assets/js/24.14d17171.js"><link rel="prefetch" href="/assets/js/25.b2ca157b.js"><link rel="prefetch" href="/assets/js/26.55d35d4f.js"><link rel="prefetch" href="/assets/js/27.005f34ff.js"><link rel="prefetch" href="/assets/js/28.a5eb93d2.js"><link rel="prefetch" href="/assets/js/29.173d87c8.js"><link rel="prefetch" href="/assets/js/30.d2985bea.js"><link rel="prefetch" href="/assets/js/31.1a5025b8.js"><link rel="prefetch" href="/assets/js/32.832c5249.js"><link rel="prefetch" href="/assets/js/33.940dfd44.js"><link rel="prefetch" href="/assets/js/34.49d78ff7.js"><link rel="prefetch" href="/assets/js/35.a04be06d.js"><link rel="prefetch" href="/assets/js/36.d63650be.js"><link rel="prefetch" href="/assets/js/37.e0153b42.js"><link rel="prefetch" href="/assets/js/38.059a51d4.js"><link rel="prefetch" href="/assets/js/39.942d570b.js"><link rel="prefetch" href="/assets/js/40.8da7d440.js"><link rel="prefetch" href="/assets/js/41.24a4fd9a.js"><link rel="prefetch" href="/assets/js/42.03a43dda.js"><link rel="prefetch" href="/assets/js/43.9b0bb612.js"><link rel="prefetch" href="/assets/js/44.a7d15b9f.js"><link rel="prefetch" href="/assets/js/45.ec543ccc.js"><link rel="prefetch" href="/assets/js/46.c1ed9730.js"><link rel="prefetch" href="/assets/js/47.0f24220f.js"><link rel="prefetch" href="/assets/js/48.c19ab66e.js"><link rel="prefetch" href="/assets/js/49.f62e3b58.js"><link rel="prefetch" href="/assets/js/5.8c798c34.js"><link rel="prefetch" href="/assets/js/50.8b3d6cae.js"><link rel="prefetch" href="/assets/js/51.e078e2e8.js"><link rel="prefetch" href="/assets/js/52.a29f5524.js"><link rel="prefetch" href="/assets/js/53.709f014a.js"><link rel="prefetch" href="/assets/js/54.57d4e764.js"><link rel="prefetch" href="/assets/js/55.812633bb.js"><link rel="prefetch" href="/assets/js/56.f682278e.js"><link rel="prefetch" href="/assets/js/57.5d950550.js"><link rel="prefetch" href="/assets/js/58.6917e3e6.js"><link rel="prefetch" href="/assets/js/59.74ce363c.js"><link rel="prefetch" href="/assets/js/6.cd87a2b3.js"><link rel="prefetch" href="/assets/js/60.7079ce04.js"><link rel="prefetch" href="/assets/js/61.d30789b5.js"><link rel="prefetch" href="/assets/js/62.c6908404.js"><link rel="prefetch" href="/assets/js/63.dfe26c31.js"><link rel="prefetch" href="/assets/js/65.61c0bfd2.js"><link rel="prefetch" href="/assets/js/66.69a87c64.js"><link rel="prefetch" href="/assets/js/67.1e397491.js"><link rel="prefetch" href="/assets/js/68.48fdc234.js"><link rel="prefetch" href="/assets/js/69.42581cdd.js"><link rel="prefetch" href="/assets/js/7.f17059bf.js"><link rel="prefetch" href="/assets/js/70.cbd191fe.js"><link rel="prefetch" href="/assets/js/71.023c6d55.js"><link rel="prefetch" href="/assets/js/8.758e7e8b.js"><link rel="prefetch" href="/assets/js/9.ef5a635a.js">
|
||
<link rel="stylesheet" href="/assets/css/0.styles.894cd3e9.css">
|
||
</head>
|
||
<body>
|
||
<div id="app" data-server-rendered="true"><div><div class="theme-container"><header class="nav"><div class="sidebar-button block md:hidden flex-no-shrink"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <div class="logo-container"><a href="/" class="home-link router-link-active"><img src="/logos/pterry.svg" class="logo"> <span class="site-name hidden md:inline can-hide">Pterodactyl</span></a></div> <div class="w-full"><div class="flex"><div class="search-box"><input aria-label="Search" placeholder="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links flex-no-shrink hidden md:flex"><div class="nav-item"><a href="/project/introduction.html" class="nav-link">Documentation
|
||
</a></div><div class="nav-item"><a href="/community/about.html" class="nav-link">Community Guides
|
||
</a></div><div class="nav-item"><a href="https://discord.gg/pterodactyl" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||
Get Help
|
||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://dashflo.net/docs/api/pterodactyl/v1/" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||
API
|
||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <div class="nav-item"><a href="https://github.com/pterodactyl/panel" target="_blank" rel="noopener noreferrer" class="nav-link">
|
||
GitHub
|
||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div></nav></div></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links flex-no-shrink block md:hidden"><div class="nav-item"><a href="/project/introduction.html" class="nav-link">Documentation
|
||
</a></div><div class="nav-item"><a href="/community/about.html" class="nav-link">Community Guides
|
||
</a></div><div class="nav-item"><a href="https://discord.gg/pterodactyl" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||
Get Help
|
||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://dashflo.net/docs/api/pterodactyl/v1/" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||
API
|
||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <div class="nav-item"><a href="https://github.com/pterodactyl/panel" target="_blank" rel="noopener noreferrer" class="nav-link">
|
||
GitHub
|
||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div></nav> <ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading open"><span>Project Information</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/project/introduction.html" class="sidebar-link">Introduction</a></li><li><a href="/project/about.html" class="sidebar-link">About</a></li><li><a href="/project/terms.html" class="sidebar-link">Terminology</a></li><li><a href="/project/community.html" class="sidebar-link">Community Standards</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Panel</span> <!----> <div tabindex="0" class="version-select custom-select float-right"><div class="selected"><div class="inline-block">
|
||
1.11
|
||
<span class="rounded-full ml-2 text-green-dark">current</span></div> <span class="arrow"></span></div> <div class="items hidden"><div class="item"><div class="inline-block">
|
||
1.11
|
||
<span class="rounded-full ml-2 text-green-dark">current</span></div></div></div></div></p> <ul class="sidebar-group-items"><li><a href="/panel/1.0/getting_started.html" class="sidebar-link">Getting Started</a></li><li><a href="/panel/1.0/webserver_configuration.html" aria-current="page" class="active sidebar-link">Webserver Configuration</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/panel/1.0/additional_configuration.html" class="sidebar-link">Additional Configuration</a></li><li><a href="/panel/1.0/updating.html" class="sidebar-link">Updating the Panel</a></li><li><a href="/panel/1.0/troubleshooting.html" class="sidebar-link">Troubleshooting</a></li><li><a href="/panel/1.0/legacy_upgrade.html" class="sidebar-link">Legacy Upgrades</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Wings</span> <!----> <div tabindex="0" class="version-select custom-select float-right"><div class="selected"><div class="inline-block">
|
||
1.11
|
||
<span class="rounded-full ml-2 text-green-dark">current</span></div> <span class="arrow"></span></div> <div class="items hidden"><div class="item"><div class="inline-block">
|
||
1.11
|
||
<span class="rounded-full ml-2 text-green-dark">current</span></div></div></div></div></p> <ul class="sidebar-group-items"><li><a href="/wings/1.0/installing.html" class="sidebar-link">Installing Wings</a></li><li><a href="/wings/1.0/upgrading.html" class="sidebar-link">Upgrading Wings</a></li><li><a href="/wings/1.0/migrating.html" class="sidebar-link">Migrating to Wings</a></li><li><a href="/wings/1.0/configuration.html" class="sidebar-link">Additional Configuration</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Tutorials</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/tutorials/mysql_setup.html" class="sidebar-link">Setting up MySQL</a></li><li><a href="/tutorials/creating_ssl_certificates.html" class="sidebar-link">Creating SSL Certificates</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Guides</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/guides/mounts.html" class="sidebar-link">Using Mounts</a></li></ul></div></li></ul> </div> <div class="page"> <div class="content content__default"><h1 id="webserver-configuration"><a href="#webserver-configuration" class="header-anchor">#</a> Webserver Configuration</h1> <div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>When using the SSL configuration you MUST create SSL certificates, otherwise your webserver will fail to start. See the <a href="/tutorials/creating_ssl_certificates.html">Creating SSL Certificates</a> documentation page to learn how to create these certificates before continuing.</p></div> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>If you are using <a href="#caddy-with-automatic-ssl">Caddy With Automatic SSL</a>, you do not have to create SSL certificates manually, Caddy will take care of it automatically.</p></div> <div class="tabs-component"><ul role="tablist" class="tabs-component-tabs"></ul> <div class="tabs-component-panels"><section aria-hidden="true" id="nginx-with-ssl" role="tabpanel" class="tabs-component-panel" style="display:none;"><p>First, remove the default NGINX configuration.</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">rm</span> /etc/nginx/sites-enabled/default
|
||
</code></pre></div><p>Now, you should paste the contents of the file below, replacing <code><domain></code> with your domain name being used in a file called
|
||
<code>pterodactyl.conf</code> and place the file in <code>/etc/nginx/sites-available/</code>, or — if on RHEL, Rocky Linux, or AlmaLinux, <code>/etc/nginx/conf.d/</code>.</p> <div class="language-conf extra-class"><div class="highlight-lines"><br><br><br><div class="highlighted"> </div><br><br><br><br><br><br><div class="highlighted"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br><br><div class="highlighted"> </div><div class="highlighted"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div><pre class="language-text"><code>server {
|
||
# Replace the example <domain> with your domain name or IP address
|
||
listen 80;
|
||
server_name <domain>;
|
||
return 301 https://$server_name$request_uri;
|
||
}
|
||
|
||
server {
|
||
# Replace the example <domain> with your domain name or IP address
|
||
listen 443 ssl http2;
|
||
server_name <domain>;
|
||
|
||
root /var/www/pterodactyl/public;
|
||
index index.php;
|
||
|
||
access_log /var/log/nginx/pterodactyl.app-access.log;
|
||
error_log /var/log/nginx/pterodactyl.app-error.log error;
|
||
|
||
# allow larger file uploads and longer script runtimes
|
||
client_max_body_size 100m;
|
||
client_body_timeout 120s;
|
||
|
||
sendfile off;
|
||
|
||
# SSL Configuration - Replace the example <domain> with your domain
|
||
ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
|
||
ssl_session_cache shared:SSL:10m;
|
||
ssl_protocols TLSv1.2 TLSv1.3;
|
||
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
|
||
ssl_prefer_server_ciphers on;
|
||
|
||
# See https://hstspreload.org/ before uncommenting the line below.
|
||
# add_header Strict-Transport-Security "max-age=15768000; preload;";
|
||
add_header X-Content-Type-Options nosniff;
|
||
add_header X-XSS-Protection "1; mode=block";
|
||
add_header X-Robots-Tag none;
|
||
add_header Content-Security-Policy "frame-ancestors 'self'";
|
||
add_header X-Frame-Options DENY;
|
||
add_header Referrer-Policy same-origin;
|
||
|
||
location / {
|
||
try_files $uri $uri/ /index.php?$query_string;
|
||
}
|
||
|
||
location ~ \.php$ {
|
||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
||
fastcgi_index index.php;
|
||
include fastcgi_params;
|
||
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||
fastcgi_param HTTP_PROXY "";
|
||
fastcgi_intercept_errors off;
|
||
fastcgi_buffer_size 16k;
|
||
fastcgi_buffers 4 16k;
|
||
fastcgi_connect_timeout 300;
|
||
fastcgi_send_timeout 300;
|
||
fastcgi_read_timeout 300;
|
||
include /etc/nginx/fastcgi_params;
|
||
}
|
||
|
||
location ~ /\.ht {
|
||
deny all;
|
||
}
|
||
}
|
||
</code></pre></div><h3 id="enabling-configuration"><a href="#enabling-configuration" class="header-anchor">#</a> Enabling Configuration</h3> <p>The final step is to enable your NGINX configuration and restart it.</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># You do not need to symlink this file if you are using RHEL, Rocky Linux, or AlmaLinux.</span>
|
||
<span class="token function">sudo</span> <span class="token function">ln</span> <span class="token parameter variable">-s</span> /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/pterodactyl.conf
|
||
|
||
<span class="token comment"># You need to restart nginx regardless of OS.</span>
|
||
<span class="token function">sudo</span> systemctl restart nginx
|
||
</code></pre></div></section> <section aria-hidden="true" id="nginx-without-ssl" role="tabpanel" class="tabs-component-panel" style="display:none;"><p>First, remove the default NGINX configuration.</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">rm</span> /etc/nginx/sites-enabled/default
|
||
</code></pre></div><p>Now, you should paste the contents of the file below, replacing <code><domain></code> with your domain name being used in a file called
|
||
<code>pterodactyl.conf</code> and place the file in <code>/etc/nginx/sites-available/</code>, or — if on RHEL, Rocky Linux, or AlmaLinux, <code>/etc/nginx/conf.d/</code>.</p> <div class="language-conf extra-class"><div class="highlight-lines"><br><br><br><div class="highlighted"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div><pre class="language-text"><code>server {
|
||
# Replace the example <domain> with your domain name or IP address
|
||
listen 80;
|
||
server_name <domain>;
|
||
|
||
root /var/www/pterodactyl/public;
|
||
index index.html index.htm index.php;
|
||
charset utf-8;
|
||
|
||
location / {
|
||
try_files $uri $uri/ /index.php?$query_string;
|
||
}
|
||
|
||
location = /favicon.ico { access_log off; log_not_found off; }
|
||
location = /robots.txt { access_log off; log_not_found off; }
|
||
|
||
access_log off;
|
||
error_log /var/log/nginx/pterodactyl.app-error.log error;
|
||
|
||
# allow larger file uploads and longer script runtimes
|
||
client_max_body_size 100m;
|
||
client_body_timeout 120s;
|
||
|
||
sendfile off;
|
||
|
||
location ~ \.php$ {
|
||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
||
fastcgi_index index.php;
|
||
include fastcgi_params;
|
||
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||
fastcgi_param HTTP_PROXY "";
|
||
fastcgi_intercept_errors off;
|
||
fastcgi_buffer_size 16k;
|
||
fastcgi_buffers 4 16k;
|
||
fastcgi_connect_timeout 300;
|
||
fastcgi_send_timeout 300;
|
||
fastcgi_read_timeout 300;
|
||
}
|
||
|
||
location ~ /\.ht {
|
||
deny all;
|
||
}
|
||
}
|
||
</code></pre></div><h3 id="enabling-configuration-2"><a href="#enabling-configuration-2" class="header-anchor">#</a> Enabling Configuration</h3> <p>The final step is to enable your NGINX configuration and restart it.</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># You do not need to symlink this file if you are using RHEL, Rocky Linux, or AlmaLinux.</span>
|
||
<span class="token function">sudo</span> <span class="token function">ln</span> <span class="token parameter variable">-s</span> /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/pterodactyl.conf
|
||
|
||
<span class="token comment"># You need to restart nginx regardless of OS.</span>
|
||
<span class="token function">sudo</span> systemctl restart nginx
|
||
</code></pre></div></section> <section aria-hidden="true" id="apache-with-ssl" role="tabpanel" class="tabs-component-panel" style="display:none;"><p>First, remove the default Apache configuration.</p> <div class="language-bash extra-class"><pre class="language-bash"><code>a2dissite 000-default.conf
|
||
</code></pre></div><p>Now, you should paste the contents of the file below, replacing <code><domain></code> with your domain name being used in a file called
|
||
<code>pterodactyl.conf</code> and place the file in <code>/etc/apache2/sites-available</code>, or — if on RHEL, Rocky Linux, or AlmaLinux, <code>/etc/httpd/conf.d/</code>.</p> <p>Note: When using Apache, make sure you have the <code>libapache2-mod-php8.3</code> package installed or else PHP will not display on your webserver.</p> <div class="language-conf extra-class"><div class="highlight-lines"><br><br><div class="highlighted"> </div><br><br><br><br><br><br><br><br><div class="highlighted"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br><div class="highlighted"> </div><div class="highlighted"> </div><br><br></div><pre class="language-text"><code><VirtualHost *:80>
|
||
# Replace the example <domain> with your domain name or IP address
|
||
ServerName <domain>
|
||
|
||
RewriteEngine On
|
||
RewriteCond %{HTTPS} !=on
|
||
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
|
||
</VirtualHost>
|
||
|
||
<VirtualHost *:443>
|
||
# Replace the example <domain> with your domain name or IP address
|
||
ServerName <domain>
|
||
DocumentRoot "/var/www/pterodactyl/public"
|
||
|
||
AllowEncodedSlashes On
|
||
|
||
php_value upload_max_filesize 100M
|
||
php_value post_max_size 100M
|
||
|
||
<Directory "/var/www/pterodactyl/public">
|
||
Require all granted
|
||
AllowOverride all
|
||
</Directory>
|
||
|
||
SSLEngine on
|
||
SSLCertificateFile /etc/letsencrypt/live/<domain>/fullchain.pem
|
||
SSLCertificateKeyFile /etc/letsencrypt/live/<domain>/privkey.pem
|
||
</VirtualHost>
|
||
</code></pre></div><h3 id="enabling-configuration-3"><a href="#enabling-configuration-3" class="header-anchor">#</a> Enabling Configuration</h3> <p>Once you've created the file above, simply run the commands below. If you are on RHEL, Rocky Linux, or AlmaLinux <em>you do not need to run the commands
|
||
below!</em> You only need to run <code>systemctl restart httpd</code>.</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># You do not need to run any of these commands on RHEL, Rocky Linux, or AlmaLinux</span>
|
||
<span class="token function">sudo</span> <span class="token function">ln</span> <span class="token parameter variable">-s</span> /etc/apache2/sites-available/pterodactyl.conf /etc/apache2/sites-enabled/pterodactyl.conf
|
||
<span class="token function">sudo</span> a2enmod rewrite
|
||
<span class="token function">sudo</span> a2enmod ssl
|
||
<span class="token function">sudo</span> systemctl restart apache2
|
||
</code></pre></div></section> <section aria-hidden="true" id="apache-without-ssl" role="tabpanel" class="tabs-component-panel" style="display:none;"><p>First, remove the default Apache configuration.</p> <div class="language-bash extra-class"><pre class="language-bash"><code>a2dissite 000-default.conf
|
||
</code></pre></div><p>Now, you should paste the contents of the file below, replacing <code><domain></code> with your domain name being used in a file called
|
||
<code>pterodactyl.conf</code> and place the file in <code>/etc/apache2/sites-available</code>, or — if on RHEL, Rocky Linux, or AlmaLinux, <code>/etc/httpd/conf.d/</code>.</p> <p>Note: When using Apache, make sure you have the <code>libapache2-mod-php8.3</code> package installed or else PHP will not display on your webserver.</p> <div class="language-conf extra-class"><div class="highlight-lines"><br><br><div class="highlighted"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br></div><pre class="language-text"><code><VirtualHost *:80>
|
||
# Replace the example <domain> with your domain name or IP address
|
||
ServerName <domain>
|
||
DocumentRoot "/var/www/pterodactyl/public"
|
||
|
||
AllowEncodedSlashes On
|
||
|
||
php_value upload_max_filesize 100M
|
||
php_value post_max_size 100M
|
||
|
||
<Directory "/var/www/pterodactyl/public">
|
||
AllowOverride all
|
||
Require all granted
|
||
</Directory>
|
||
</VirtualHost>
|
||
</code></pre></div><h3 id="enabling-configuration-4"><a href="#enabling-configuration-4" class="header-anchor">#</a> Enabling Configuration</h3> <p>Once you've created the file above, simply run the commands below. If you are on RHEL, Rocky Linux, or AlmaLinux <em>you do not need to run the commands
|
||
below!</em> You only need to run <code>systemctl restart httpd</code>.</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># You do not need to run any of these commands on RHEL, Rocky Linux, or AlmaLinux</span>
|
||
<span class="token function">sudo</span> <span class="token function">ln</span> <span class="token parameter variable">-s</span> /etc/apache2/sites-available/pterodactyl.conf /etc/apache2/sites-enabled/pterodactyl.conf
|
||
<span class="token function">sudo</span> a2enmod rewrite
|
||
<span class="token function">sudo</span> systemctl restart apache2
|
||
</code></pre></div></section> <section aria-hidden="true" id="caddy-with-automatic-ssl" role="tabpanel" class="tabs-component-panel" style="display:none;"><p>Before adding our custom configuration, let's remove the default one. You can do it either by deleting the contents of config file or by deleting the config file completely and than creating a new one from scratch. The config file path is <code>/etc/caddy/Caddyfile</code>.</p> <p>To delete the config file completely, run the following command:</p> <div class="language-shell extra-class"><pre class="language-shell"><code><span class="token function">rm</span> /etc/caddy/Caddyfile
|
||
</code></pre></div><p>Then continue with an editor of your choice to write the config.</p> <p>You should paste the contents of the file below, replacing <code><domain></code> with your domain name.</p> <div class="language- extra-class"><div class="highlight-lines"><br><br><br><br><br><br><br><br><br><div class="highlighted"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div><pre class="language-text"><code>{
|
||
servers :443 {
|
||
timeouts {
|
||
read_body 120s
|
||
}
|
||
}
|
||
}
|
||
|
||
# Replace the example <domain> with your domain name or IP address
|
||
<domain> {
|
||
root * /var/www/pterodactyl/public
|
||
|
||
file_server
|
||
|
||
php_fastcgi unix//run/php/php8.3-fpm.sock {
|
||
root /var/www/pterodactyl/public
|
||
index index.php
|
||
|
||
env PHP_VALUE "upload_max_filesize = 100M
|
||
post_max_size = 100M"
|
||
env HTTP_PROXY ""
|
||
env HTTPS "on"
|
||
|
||
read_timeout 300s
|
||
dial_timeout 300s
|
||
write_timeout 300s
|
||
}
|
||
|
||
header Strict-Transport-Security "max-age=16768000; preload;"
|
||
header X-Content-Type-Options "nosniff"
|
||
header X-XSS-Protection "1; mode=block;"
|
||
header X-Robots-Tag "none"
|
||
header Content-Security-Policy "frame-ancestors 'self'"
|
||
header X-Frame-Options "DENY"
|
||
header Referrer-Policy "same-origin"
|
||
|
||
request_body {
|
||
max_size 100m
|
||
}
|
||
|
||
respond /.ht* 403
|
||
|
||
log {
|
||
output file /var/log/caddy/pterodactyl.log {
|
||
roll_size 100MiB
|
||
roll_keep_for 7d
|
||
}
|
||
level INFO
|
||
}
|
||
}</code></pre></div><div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>If you are using Cloudflare DNS in proxy mode, refer to <a href="/tutorials/creating_ssl_certificates.html#method-3:-caddy-(using-cloudflare-api)">this tutorial</a>, to see how to configure Caddy to use DNS challenge for obtaining SSL certificates.</p></div> <h3 id="enabling-configuration-5"><a href="#enabling-configuration-5" class="header-anchor">#</a> Enabling Configuration</h3> <p>The final step is to restart Caddy.</p> <div class="language-bash extra-class"><pre class="language-bash"><code>systemctl restart caddy
|
||
</code></pre></div></section> <section aria-hidden="true" id="caddy-without-ssl" role="tabpanel" class="tabs-component-panel" style="display:none;"><p>Before adding our custom configuration, let's remove the default one. You can do it either by deleting the contents of config file or by deleting the config file completely and than creating a new one from scratch. The config file path is <code>/etc/caddy/Caddyfile</code>.</p> <p>To delete the config file completely, run the following command:</p> <div class="language-shell extra-class"><pre class="language-shell"><code><span class="token function">rm</span> /etc/caddy/Caddyfile
|
||
</code></pre></div><p>Then continue with an editor of your choice to write the config.</p> <p>You should paste the contents of the file below, replacing <code><domain></code> with your domain name.</p> <p>The only two differences are that we have suffixed the <code><domain></code> with <code>:80</code> and in the global config at <code>servers</code> directive, we have changed the port from <code>:443</code> to <code>:80</code>.</p> <div class="language- extra-class"><div class="highlight-lines"><br><br><br><br><br><br><br><br><br><div class="highlighted"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div><pre class="language-text"><code>{
|
||
servers :80 {
|
||
timeouts {
|
||
read_body 120s
|
||
}
|
||
}
|
||
}
|
||
|
||
# Replace the example <domain> with your domain name or IP address
|
||
<domain>:80 {
|
||
root * /var/www/pterodactyl/public
|
||
|
||
file_server
|
||
|
||
php_fastcgi unix//run/php/php8.3-fpm.sock {
|
||
root /var/www/pterodactyl/public
|
||
index index.php
|
||
|
||
env PHP_VALUE "upload_max_filesize = 100M
|
||
post_max_size = 100M"
|
||
env HTTP_PROXY ""
|
||
# env HTTPS "on" # IMPORTANT: this is commented out, to disable HTTPS
|
||
|
||
read_timeout 300s
|
||
dial_timeout 300s
|
||
write_timeout 300s
|
||
}
|
||
|
||
header Strict-Transport-Security "max-age=16768000; preload;"
|
||
header X-Content-Type-Options "nosniff"
|
||
header X-XSS-Protection "1; mode=block;"
|
||
header X-Robots-Tag "none"
|
||
header Content-Security-Policy "frame-ancestors 'self'"
|
||
header X-Frame-Options "DENY"
|
||
header Referrer-Policy "same-origin"
|
||
|
||
request_body {
|
||
max_size 100m
|
||
}
|
||
|
||
respond /.ht* 403
|
||
|
||
log {
|
||
output file /var/log/caddy/pterodactyl.log {
|
||
roll_size 100MiB
|
||
roll_keep_for 7d
|
||
}
|
||
level INFO
|
||
}
|
||
}</code></pre></div><h3 id="enabling-configuration-6"><a href="#enabling-configuration-6" class="header-anchor">#</a> Enabling Configuration</h3> <p>The final step is to restart Caddy.</p> <div class="language-bash extra-class"><pre class="language-bash"><code>systemctl restart caddy
|
||
</code></pre></div></section></div></div> <h4 id="next-step-wings-installation"><a href="#next-step-wings-installation" class="header-anchor">#</a> Next Step: <a href="/wings/installing.html">Wings Installation</a></h4></div> <div class="page-edit"><div class="edit-link"><a href="https://github.com/pterodactyl/documentation/edit/master/panel/1.0/webserver_configuration.md" target="_blank" rel="noopener noreferrer">Help us improve this page.</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----></div> <!----> </div></div></div><div class="global-ui"></div></div>
|
||
<script src="/assets/js/app.322e86a5.js" defer></script><script src="/assets/js/4.0da8214b.js" defer></script><script src="/assets/js/2.638bc23b.js" defer></script><script src="/assets/js/64.c028aa01.js" defer></script>
|
||
</body>
|
||
</html>
|