refactor: update Nginx configuration and Docker setup
- Change user directive in Nginx configuration from 'nginx' to 'www-data'. - Update upstream server configurations in Nginx to use 'localhost' instead of service names. - Modify Nginx server block to redirect HTTP to a status page instead of Grafana. - Rename Alertmanager location from '/alertmanager/' to '/alerts/' for consistency. - Remove deprecated status page configuration and related files. - Adjust Prometheus configuration to reflect the new Docker network settings.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
user nginx;
|
||||
user www-data;
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
@@ -65,26 +65,27 @@ http {
|
||||
|
||||
# Upstream configurations
|
||||
upstream grafana_backend {
|
||||
server grafana:3000;
|
||||
server localhost:3000;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
upstream prometheus_backend {
|
||||
server prometheus:9090;
|
||||
server localhost:9090;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
upstream uptime_kuma_backend {
|
||||
server uptime-kuma:3001;
|
||||
server localhost:3001;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
upstream alertmanager_backend {
|
||||
server alertmanager:9093;
|
||||
server localhost:9093;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
# Main server block
|
||||
# Redirect HTTP to HTTPS
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
@@ -96,8 +97,8 @@ http {
|
||||
server_name _;
|
||||
|
||||
# SSL configuration (self-signed certificate)
|
||||
ssl_certificate /etc/letsencrypt/live/{{SERVER_IP}}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{SERVER_IP}}/privkey.pem;еще
|
||||
ssl_certificate /etc/nginx/ssl/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384;
|
||||
ssl_prefer_server_ciphers off;
|
||||
@@ -108,9 +109,10 @@ http {
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
|
||||
# Redirect root to Grafana
|
||||
# Root page - show simple status
|
||||
location = / {
|
||||
return 301 /grafana/;
|
||||
return 200 "Bot Infrastructure Status\n\nServices:\n- Grafana: /grafana/\n- Prometheus: /prometheus/\n- Uptime Kuma: /status/\n- Alertmanager: /alerts/\n";
|
||||
add_header Content-Type text/plain;
|
||||
}
|
||||
|
||||
# Health check endpoint
|
||||
|
||||
Reference in New Issue
Block a user