remove private nginx.conf
This commit is contained in:
@@ -2,6 +2,35 @@
|
||||
|
||||
## Initial Install
|
||||
|
||||
Create your initial `secrets/nginx.conf` to look something like:
|
||||
|
||||
```conf
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
stream {
|
||||
log_format stream_logs '$remote_addr [$time_local] $protocol $status $bytes_sent $bytes_received $session_time "$upstream_addr"';
|
||||
|
||||
access_log /dev/stdout stream_logs;
|
||||
error_log stderr info;
|
||||
|
||||
server {
|
||||
listen 25565;
|
||||
listen [::]:25565;
|
||||
proxy_pass my-minecraft-server.internal.dns:25565;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Create the systemd service:
|
||||
|
||||
```bash
|
||||
# Get the initial configuration
|
||||
vim /etc/containers/systemd/nginx.container
|
||||
@@ -26,11 +55,27 @@ Restart=always
|
||||
WantedBy=default.target
|
||||
```
|
||||
|
||||
## Update the Configuration
|
||||
Reload the service and start it:
|
||||
|
||||
```bash
|
||||
scp active/container_nginx/nginx.conf proxy:/etc/nginx/nginx.conf
|
||||
ssh proxy
|
||||
systemctl daemon-reload
|
||||
systemctl start nginx
|
||||
```
|
||||
|
||||
## Update the Configuration
|
||||
|
||||
```bash
|
||||
scp active/container_nginx/secrets/nginx.conf proxy:/etc/nginx/nginx.conf
|
||||
ssh proxy
|
||||
systemctl restart nginx
|
||||
```
|
||||
|
||||
## Logs
|
||||
|
||||
```bash
|
||||
# Watch client connections
|
||||
journalctl -u nginx -f | grep -e 'client .* connected'
|
||||
|
||||
# Watch upstream proxy connections
|
||||
journalctl -u nginx -f | grep -e 'proxy .* connected'
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user