remove private nginx.conf
This commit is contained in:
@@ -1,46 +0,0 @@
|
|||||||
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 3478;
|
|
||||||
listen [::]:3478;
|
|
||||||
proxy_pass nextcloud.reeselink.com:3478;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 2222;
|
|
||||||
listen [::]:2222;
|
|
||||||
proxy_pass gitea.reeselink.com:2222;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 8080;
|
|
||||||
listen [::]:8080;
|
|
||||||
proxy_pass unifi-external.reeselink.com:2222;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 25565;
|
|
||||||
listen [::]:25565;
|
|
||||||
proxy_pass minecraft.reeselink.com:25565;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 25566;
|
|
||||||
listen [::]:25566;
|
|
||||||
proxy_pass minecraft.reeselink.com:25566;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,35 @@
|
|||||||
|
|
||||||
## Initial Install
|
## 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
|
```bash
|
||||||
# Get the initial configuration
|
# Get the initial configuration
|
||||||
vim /etc/containers/systemd/nginx.container
|
vim /etc/containers/systemd/nginx.container
|
||||||
@@ -26,11 +55,27 @@ Restart=always
|
|||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
```
|
```
|
||||||
|
|
||||||
## Update the Configuration
|
Reload the service and start it:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
scp active/container_nginx/nginx.conf proxy:/etc/nginx/nginx.conf
|
|
||||||
ssh proxy
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl start nginx
|
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