Skip to content

Commit b345ca7

Browse files
committed
Add nginx logs & update nginx to 1.26.0
1 parent cfa62dd commit b345ca7

File tree

7 files changed

+25
-8
lines changed

7 files changed

+25
-8
lines changed

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*]
2+
end_of_line = lf

.env.example

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
INITIAL_HOST="51.195.41.202" # gommehd.net
2-
INITIAL_PORT="25565"
1+
TZ="Europe/Berlin"
32
LOCAL_PORT="1000"
3+
4+
INITIAL_HOST="gommehd.net"
5+
# INITIAL_HOST="49.13.113.19"
6+
INITIAL_PORT="25565"

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ docker run -p 25565:25565 -e INITIAL_HOST=<host> -e INITIAL_PORT=<port> vollborn
2121
You can also use docker-compose.
2222
Example docker-compose.yml:
2323
```yml
24-
version: '3.1'
24+
version: "3.8"
2525

2626
services:
2727
proxy:
2828
image: vollborn/minecraft-nginx-reverse-proxy
2929
restart: unless-stopped
3030
ports:
31-
- "25565:25565"
31+
- "${LOCAL_PORT:-25565}:25565"
3232
environment:
3333
INITIAL_HOST: <host>
3434
INITIAL_PORT: <port>
35+
# TZ: "Europe/Berlin"
3536
```
3637

3738
Here we go.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3.1'
1+
version: "3.8"
22

33
services:
44
proxy:

src/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
FROM debian:latest
1+
FROM debian:12
22

33
LABEL maintainer="vollborn <oliver.vollborn@gmail.com>"
4-
LABEL version="1.2.2"
4+
LABEL version="1.3.0"
55
LABEL description="a simple nginx reverse proxy for minecraft servers"
66

7+
ENV TZ="Europe/Berlin"
8+
79
ENV INITIAL_HOST=""
810
ENV INITIAL_PORT=""
911

@@ -13,7 +15,7 @@ RUN apt-get update && apt-get -y upgrade && \
1315

1416
WORKDIR /opt
1517

16-
RUN wget https://nginx.org/download/nginx-1.23.4.tar.gz && \
18+
RUN wget https://nginx.org/download/nginx-1.26.0.tar.gz && \
1719
tar -zxvf nginx-1.*.tar.gz && \
1820
cd nginx-1.* && \
1921
./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-http_ssl_module --with-ipv6 --with-threads --with-stream --with-stream_ssl_module && \
@@ -34,6 +36,10 @@ ADD nginx.conf /opt/nginx/conf/nginx.conf
3436
RUN chmod +x /opt/startup.sh
3537
RUN chmod +x /opt/set_host.sh
3638

39+
RUN mkdir -p /var/log/nginx
40+
RUN ln -s /dev/stdout /var/log/nginx/access.log
41+
RUN ln -s /dev/stderr /var/log/nginx/error.log
42+
3743
EXPOSE 25565
3844

3945
CMD ["/opt/startup.sh"]

src/minecraft.template.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
server {
22
listen 25565;
33
proxy_pass <host>:<port>;
4+
5+
access_log /var/log/nginx/access.log basic;
6+
error_log /var/log/nginx/error.log;
47
}

src/nginx.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ events {
66
}
77

88
stream {
9+
log_format basic '$remote_addr - $time_iso8601';
10+
911
include /opt/nginx/stream.conf.d/*.conf;
1012
}

0 commit comments

Comments
 (0)