Skip to content

Commit c2c4e9a

Browse files
committed
Add https support for map
1 parent bdd4407 commit c2c4e9a

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

docker-compose.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ services:
33
image: itzg/minecraft-server
44
ports:
55
- 25565:25565 # minecraft
6-
- 8080:8080 # map
76
environment:
87
# ===== CUSTOM CONFIG =====
98
CFG_DISCORD_CHAT_CHANNEL: 1220720732854816788
@@ -16,7 +15,8 @@ services:
1615
CFG_DISCORD_VOICE_ENABLED: "true"
1716
CFG_DISCORD_VOICE_CATEGORY: 000000000000000000
1817
CFG_DISCORD_VOICE_LOBBY_CHANNEL: 000000000000000000
19-
CFG_MAP_WEB_ADDRESS: "http://localhost:8080"
18+
CFG_MAP_WEB_ADDRESS: "https://example.com"
19+
CFG_MAP_INTERNAL_WEBSERVER_PORT: 80
2020
ICON: "https://cdn.discordapp.com/avatars/1220700277573816330/037d7503e3970212dd8e8838822c0605.png?size=64"
2121
MOTD: "Witaj na \u00A7l\u00A74ProgramowanieCraft\u00A7r!\u00A7r\n\u00A79discord.gg/programowanie-819892011364122624\u00A7r"
2222
OPS: |
@@ -56,6 +56,7 @@ services:
5656
- ./plugins:/plugins:ro
5757
- ./config-patches:/config-patches:ro
5858
- minecraftdata:/data
59+
5960
database:
6061
image: mariadb:lts
6162
environment:
@@ -70,6 +71,24 @@ services:
7071
- ./mariadb.conf.d:/etc/mysql/conf.d:ro
7172
- minecraftdbdata:/var/lib/mysql
7273

74+
map:
75+
image: nginx:latest
76+
ports:
77+
- 443:443
78+
- 80:80
79+
volumes:
80+
- ./map/conf/:/etc/nginx/conf.d/:ro
81+
- ./map/certbot/www/:/var/www/certbot/:ro
82+
- ./map/certbot/conf/:/etc/nginx/ssl/:ro
83+
depends_on:
84+
- minecraft
85+
86+
certbot:
87+
image: certbot/certbot:latest
88+
volumes:
89+
- ./map/certbot/www/:/var/www/certbot/:rw
90+
- ./map/certbot/conf/:/etc/letsencrypt/:rw
91+
7392
volumes:
7493
minecraftdata:
7594
external: "true"

map/conf/nginx.conf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
server {
2+
listen 80;
3+
4+
server_name example.com www.example.com;
5+
server_tokens off;
6+
7+
location /.well-known/acme-challenge/ {
8+
root /var/www/certbot;
9+
}
10+
11+
location / {
12+
return 301 https://example.com$request_uri;
13+
}
14+
}
15+
16+
server {
17+
listen 443 ssl;
18+
19+
server_name www.example.com;
20+
21+
ssl_certificate /etc/nginx/ssl/live/example.com/fullchain.pem;
22+
ssl_certificate_key /etc/nginx/ssl/live/example.com/privkey.pem;
23+
24+
location / {
25+
return 301 https://example.com$request_uri;
26+
}
27+
}
28+
29+
server {
30+
listen 443 default_server ssl;
31+
32+
server_name example.com;
33+
34+
ssl_certificate /etc/nginx/ssl/live/example.com/fullchain.pem;
35+
ssl_certificate_key /etc/nginx/ssl/live/example.com/privkey.pem;
36+
37+
location / {
38+
proxy_pass http://minecraft:80;
39+
}
40+
}

plugins/Pl3xMap/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ settings:
5252
bind: 0.0.0.0
5353
# The port the built-in web server listens to.
5454
# Make sure the port is allocated if using Pterodactyl.
55-
port: 8080
55+
port: ${CFG_MAP_INTERNAL_WEBSERVER_PORT}
5656
# Allows the built-in web server to follow symlinks.
5757
# It is generally advised against enabling this,
5858
# for security reasons. But you do you, boo boo.

0 commit comments

Comments
 (0)