documentation/panel/0.7/webserver_configuration.html
2021-12-02 18:24:37 +00:00

216 lines
26 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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.8.2">
<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 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.">
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
<meta name="theme-color" content="#0e4688">
<link rel="preload" href="/assets/css/0.styles.b4cb0fef.css" as="style"><link rel="preload" href="/assets/js/app.f31aac4f.js" as="script"><link rel="preload" href="/assets/js/4.bff5ff58.js" as="script"><link rel="preload" href="/assets/js/1.79a56ae5.js" as="script"><link rel="preload" href="/assets/js/65.81003f00.js" as="script"><link rel="prefetch" href="/assets/js/10.27cec751.js"><link rel="prefetch" href="/assets/js/11.27ba30b0.js"><link rel="prefetch" href="/assets/js/12.2e01246c.js"><link rel="prefetch" href="/assets/js/13.bd04c4ec.js"><link rel="prefetch" href="/assets/js/14.f2be742e.js"><link rel="prefetch" href="/assets/js/15.a6802091.js"><link rel="prefetch" href="/assets/js/16.f2dea920.js"><link rel="prefetch" href="/assets/js/17.e3b378b0.js"><link rel="prefetch" href="/assets/js/18.fcb158a9.js"><link rel="prefetch" href="/assets/js/19.f9b16a1f.js"><link rel="prefetch" href="/assets/js/2.21e1a937.js"><link rel="prefetch" href="/assets/js/20.a31cd600.js"><link rel="prefetch" href="/assets/js/21.986dab58.js"><link rel="prefetch" href="/assets/js/22.01e99816.js"><link rel="prefetch" href="/assets/js/23.ab477db3.js"><link rel="prefetch" href="/assets/js/24.3db401dc.js"><link rel="prefetch" href="/assets/js/25.fb19183c.js"><link rel="prefetch" href="/assets/js/26.199e42e5.js"><link rel="prefetch" href="/assets/js/27.53b2955f.js"><link rel="prefetch" href="/assets/js/28.b1cca863.js"><link rel="prefetch" href="/assets/js/29.c234f3e0.js"><link rel="prefetch" href="/assets/js/30.61a90133.js"><link rel="prefetch" href="/assets/js/31.6cbb938e.js"><link rel="prefetch" href="/assets/js/32.7effab83.js"><link rel="prefetch" href="/assets/js/33.5cb72a20.js"><link rel="prefetch" href="/assets/js/34.f044669f.js"><link rel="prefetch" href="/assets/js/35.6b4fc97c.js"><link rel="prefetch" href="/assets/js/36.65b28a90.js"><link rel="prefetch" href="/assets/js/37.b81f7a4e.js"><link rel="prefetch" href="/assets/js/38.e385c788.js"><link rel="prefetch" href="/assets/js/39.a7036ff5.js"><link rel="prefetch" href="/assets/js/40.5561e292.js"><link rel="prefetch" href="/assets/js/41.8357cc2d.js"><link rel="prefetch" href="/assets/js/42.ed9e1c27.js"><link rel="prefetch" href="/assets/js/43.9fd714d5.js"><link rel="prefetch" href="/assets/js/44.5250ac95.js"><link rel="prefetch" href="/assets/js/45.3ebbab0e.js"><link rel="prefetch" href="/assets/js/46.a3168226.js"><link rel="prefetch" href="/assets/js/47.7a0c0c49.js"><link rel="prefetch" href="/assets/js/48.8b4df094.js"><link rel="prefetch" href="/assets/js/49.1e699f40.js"><link rel="prefetch" href="/assets/js/5.407df260.js"><link rel="prefetch" href="/assets/js/50.fb545b0b.js"><link rel="prefetch" href="/assets/js/51.8bf819d3.js"><link rel="prefetch" href="/assets/js/52.c0fa38e2.js"><link rel="prefetch" href="/assets/js/53.acaa8c4b.js"><link rel="prefetch" href="/assets/js/54.01f718b6.js"><link rel="prefetch" href="/assets/js/55.0c83194a.js"><link rel="prefetch" href="/assets/js/56.488f03fe.js"><link rel="prefetch" href="/assets/js/57.6cdf7d48.js"><link rel="prefetch" href="/assets/js/58.139108d1.js"><link rel="prefetch" href="/assets/js/59.2de63e9e.js"><link rel="prefetch" href="/assets/js/6.8999fd8a.js"><link rel="prefetch" href="/assets/js/60.a35a1994.js"><link rel="prefetch" href="/assets/js/61.c644eb6e.js"><link rel="prefetch" href="/assets/js/62.6d624b0b.js"><link rel="prefetch" href="/assets/js/63.08f06847.js"><link rel="prefetch" href="/assets/js/64.8d69a757.js"><link rel="prefetch" href="/assets/js/66.74fe8562.js"><link rel="prefetch" href="/assets/js/67.5e77d3dd.js"><link rel="prefetch" href="/assets/js/68.e7498700.js"><link rel="prefetch" href="/assets/js/69.bb730956.js"><link rel="prefetch" href="/assets/js/7.9f1ce256.js"><link rel="prefetch" href="/assets/js/70.da6650f2.js"><link rel="prefetch" href="/assets/js/71.40f85a31.js"><link rel="prefetch" href="/assets/js/72.7f5dd9c7.js"><link rel="prefetch" href="/assets/js/73.3c0e5aad.js"><link rel="prefetch" href="/assets/js/74.1351a3ef.js"><link rel="prefetch" href="/assets/js/75.6351ca99.js"><link rel="prefetch" href="/assets/js/76.0b5f8895.js"><link rel="prefetch" href="/assets/js/77.54ccbb7a.js"><link rel="prefetch" href="/assets/js/78.8bca8e5f.js"><link rel="prefetch" href="/assets/js/8.c1f22b35.js"><link rel="prefetch" href="/assets/js/9.7af626f7.js">
<link rel="stylesheet" href="/assets/css/0.styles.b4cb0fef.css">
</head>
<body>
<div id="app" data-server-rendered="true"><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">
Contribute
<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">
Contribute
<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.6
<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.6
<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" class="sidebar-link">Webserver Configuration</a></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.5
<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.5
<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><li><div class="sidebar-group collapsable"><p class="sidebar-heading"><span>Development &amp; Ops</span> <span class="arrow right"></span> <!----></p> <!----></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 danger"><p class="custom-block-title">This Version is End-of-Life</p> <p>This documentation is for <strong>end-of-life software</strong> which does not recieve any security updates or support
from the community. This documentation has been left accessible for historial reasons.</p> <p>You should be installing and using <a href="/panel/1.0/getting_started.html">Pterodactyl Panel 1.0</a> in production environments.</p></div> <p></p><div class="table-of-contents"><ul><li><a href="#nginx">NGINX</a><ul><li><a href="#nginx-with-ssl">NGINX With SSL</a></li><li><a href="#nginx-without-ssl">NGINX Without SSL</a></li><li><a href="#enabling-configuration">Enabling Configuration</a></li></ul></li><li><a href="#apache">Apache</a><ul><li><a href="#apache-with-ssl">Apache With SSL</a></li><li><a href="#apache-without-ssl">Apache Without SSL</a></li><li><a href="#enabling-configuration">Enabling Configuration</a></li></ul></li></ul></div><p></p> <div class="custom-block danger"><p class="custom-block-title">DANGER</p> <p>You should remove the default Apache or NGINX configuration as it will expose application secrets to malicious
users by default.</p></div> <h2 id="nginx"><a href="#nginx" class="header-anchor">#</a> NGINX</h2> <p>You should paste the contents of the file below, replacing <code>&lt;domain&gt;</code> with your domain name being used in a file called
<code>pterodactyl.conf</code> and place it in <code>/etc/nginx/sites-available/</code>, or — if on CentOS, <code>/etc/nginx/conf.d/</code>.</p> <h3 id="nginx-with-ssl"><a href="#nginx-with-ssl" class="header-anchor">#</a> NGINX With SSL</h3> <p>This configuration assumes that you will be using SSL on both the Panel and Daemons for significantly improved communication
security between users and the Panel. You will need to get a valid SSL certificate which can be done for free by using
Let's Encrypt.</p> <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 NGINX will fail to start. See <a href="/tutorials/creating_ssl_certificates.html">Creating SSL Certificates</a> documentation page for how to create these certificates before continuing.</p></div> <div class="language-conf extra-class"><div class="highlight-lines"><br><br><br><br><div class="highlighted"> </div><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_tokens off;
server {
listen 80;
server_name &lt;domain&gt;;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name &lt;domain&gt;;
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
ssl_certificate /etc/letsencrypt/live/&lt;domain&gt;/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/&lt;domain&gt;/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers &quot;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&quot;;
ssl_prefer_server_ciphers on;
# See https://hstspreload.org/ before uncommenting the line below.
# add_header Strict-Transport-Security &quot;max-age=15768000; preload;&quot;;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection &quot;1; mode=block&quot;;
add_header X-Robots-Tag none;
add_header Content-Security-Policy &quot;frame-ancestors 'self'&quot;;
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/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PHP_VALUE &quot;upload_max_filesize = 100M \n post_max_size=100M&quot;;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY &quot;&quot;;
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><p>Continue reading to the bottom of this section for the final steps with NGINX!</p> <h3 id="nginx-without-ssl"><a href="#nginx-without-ssl" class="header-anchor">#</a> NGINX Without SSL</h3> <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><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 {
listen 80;
server_name &lt;domain&gt;;
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/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PHP_VALUE &quot;upload_max_filesize = 100M \n post_max_size=100M&quot;;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY &quot;&quot;;
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"><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 CentOS.</span>
<span class="token function">sudo</span> <span class="token function">ln</span> -s /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>
systemctl restart nginx
</code></pre></div><h2 id="apache"><a href="#apache" class="header-anchor">#</a> Apache</h2> <p>You should paste the contents of the file below, replacing <code>&lt;domain&gt;</code> with your domain name being used in a file called
<code>pterodactyl.conf</code> and place it in <code>/etc/apache2/sites-available</code>, or — if on CentOS, <code>/etc/httpd/conf.d/</code>.</p> <p>Note: When using Apache, make sure you have the <code>libapache2-mod-php</code> package installed or else PHP will not display on your webserver.</p> <h3 id="apache-with-ssl"><a href="#apache-with-ssl" class="header-anchor">#</a> Apache With SSL</h3> <p>Like the nginx configuration, this assumes you will be using SSL on both the Panel and Daemons for improved security.</p> <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 Apache will fail to start. See <a href="/tutorials/creating_ssl_certificates.html">Creating SSL Certificates</a> documentation page for how to create these certificates before continuing.</p></div> <div class="language-conf extra-class"><div class="highlight-lines"><br><div class="highlighted"> </div><br><br><br><br><br><div class="highlighted"> </div><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></div><pre class="language-text"><code>&lt;VirtualHost *:80&gt;
ServerName &lt;domain&gt;
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
&lt;/VirtualHost&gt;
&lt;VirtualHost *:443&gt;
ServerName &lt;domain&gt;
DocumentRoot &quot;/var/www/pterodactyl/public&quot;
AllowEncodedSlashes On
php_value upload_max_filesize 100M
php_value post_max_size 100M
&lt;Directory &quot;/var/www/pterodactyl/public&quot;&gt;
Require all granted
AllowOverride all
&lt;/Directory&gt;
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/&lt;domain&gt;/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/&lt;domain&gt;/privkey.pem
&lt;/VirtualHost&gt;
</code></pre></div><h3 id="apache-without-ssl"><a href="#apache-without-ssl" class="header-anchor">#</a> Apache Without SSL</h3> <div class="language-conf extra-class"><div class="highlight-lines"><br><div class="highlighted"> </div><br><br><br><br><br><br><br><br><br><br><br><br><br></div><pre class="language-text"><code>&lt;VirtualHost *:80&gt;
ServerName &lt;domain&gt;
DocumentRoot &quot;/var/www/pterodactyl/public&quot;
AllowEncodedSlashes On
php_value upload_max_filesize 100M
php_value post_max_size 100M
&lt;Directory &quot;/var/www/pterodactyl/public&quot;&gt;
AllowOverride all
Require all granted
&lt;/Directory&gt;
&lt;/VirtualHost&gt;
</code></pre></div><h3 id="enabling-configuration-2"><a href="#enabling-configuration-2" class="header-anchor">#</a> Enabling Configuration</h3> <p>Once you've created the file above, simply run the commands below. If you are on CentOS <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 CentOS</span>
<span class="token function">sudo</span> <span class="token function">ln</span> -s /etc/apache2/sites-available/pterodactyl.conf /etc/apache2/sites-enabled/pterodactyl.conf
<span class="token function">sudo</span> a2enmod rewrite
systemctl restart apache2
</code></pre></div></div> <div class="page-edit"><div class="edit-link"><a href="https://github.com/pterodactyl/documentation/edit/master/panel/0.7/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 class="global-ui"></div></div>
<script src="/assets/js/app.f31aac4f.js" defer></script><script src="/assets/js/4.bff5ff58.js" defer></script><script src="/assets/js/1.79a56ae5.js" defer></script><script src="/assets/js/65.81003f00.js" defer></script>
</body>
</html>