1+ ## Version 2023/05/08
2+ # this is for nodes, not your actual panel
3+ # make sure you set your node to use 443 as its API port
4+ # make sure that your pterodactylnode container is named pterodactylnode
5+ # make sure that your dns has a cname set for pterodactylnode
6+
7+ server {
8+ listen 443 ssl;
9+ listen [::]:443 ssl;
10+
11+ server_name pterodactylnode.*;
12+
13+ include /config/nginx/ssl.conf;
14+
15+ client_max_body_size 0;
16+
17+ # enable for ldap auth (requires ldap-location.conf in the location block)
18+ #include /config/nginx/ldap-server.conf;
19+
20+ # enable for Authelia (requires authelia-location.conf in the location block)
21+ #include /config/nginx/authelia-server.conf;
22+
23+ # enable for Authentik (requires authentik-location.conf in the location block)
24+ #include /config/nginx/authentik-server.conf;
25+
26+ location ~ ^\/api\/servers\/(?<serverid>.*)?\/ws$ {
27+
28+ include /config/nginx/proxy.conf;
29+ include /config/nginx/resolver.conf;
30+ set $upstream_app pterodactylnode;
31+ set $upstream_port 443;
32+ set $upstream_proto http;
33+ proxy_pass $upstream_proto://$upstream_app:$upstream_port/api/servers/$serverid/ws;
34+ proxy_set_header Upgrade $http_upgrade;
35+ proxy_set_header Connection "upgrade";
36+ }
37+
38+ location / {
39+ # enable the next two lines for http auth
40+ #auth_basic "Restricted";
41+ #auth_basic_user_file /config/nginx/.htpasswd;
42+
43+ # enable for ldap auth (requires ldap-server.conf in the server block)
44+ #include /config/nginx/ldap-location.conf;
45+
46+ # enable for Authelia (requires authelia-server.conf in the server block)
47+ #include /config/nginx/authelia-location.conf;
48+
49+ # enable for Authentik (requires authentik-server.conf in the server block)
50+ #include /config/nginx/authentik-location.conf;
51+
52+ include /config/nginx/proxy.conf;
53+ include /config/nginx/resolver.conf;
54+ set $upstream_app pterodactylnode;
55+ set $upstream_port 443;
56+ set $upstream_proto http;
57+ proxy_pass $upstream_proto://$upstream_app:$upstream_port;
58+
59+ }
60+ }
0 commit comments