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:
@@ -2,12 +2,12 @@
|
||||
# Proxies requests to Alertmanager
|
||||
|
||||
# Alertmanager location
|
||||
location /alertmanager/ {
|
||||
location /alerts/ {
|
||||
# Rate limiting
|
||||
limit_req zone=api burst=10 nodelay;
|
||||
|
||||
# Remove trailing slash for proxy
|
||||
rewrite ^/alertmanager/(.*)$ /$1 break;
|
||||
rewrite ^/alerts/(.*)$ /$1 break;
|
||||
|
||||
# Proxy to Alertmanager
|
||||
proxy_pass http://alertmanager_backend;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Grafana proxy configuration
|
||||
location /grafana/ {
|
||||
proxy_pass http://grafana_backend/;
|
||||
proxy_pass http://grafana_backend;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
# Status page configuration (Uptime Kuma integration)
|
||||
|
||||
# Rate limiting for status page
|
||||
location /status {
|
||||
# Rate limiting
|
||||
limit_req zone=status burst=5 nodelay;
|
||||
|
||||
# Proxy to Uptime Kuma
|
||||
proxy_pass http://uptime_kuma_backend;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# WebSocket support
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
# Timeouts
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
|
||||
# Buffer settings
|
||||
proxy_buffering on;
|
||||
proxy_buffer_size 4k;
|
||||
proxy_buffers 8 4k;
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
}
|
||||
|
||||
# Nginx status stub (for monitoring)
|
||||
location /nginx_status {
|
||||
stub_status on;
|
||||
access_log off;
|
||||
allow 127.0.0.1;
|
||||
allow 172.16.0.0/12; # Docker networks
|
||||
allow 192.168.0.0/16; # Private networks
|
||||
deny all;
|
||||
}
|
||||
@@ -1,12 +1,6 @@
|
||||
# Uptime Kuma Nginx Configuration
|
||||
# Proxies requests to Uptime Kuma status page
|
||||
|
||||
# Upstream for Uptime Kuma
|
||||
upstream uptime_kuma_backend {
|
||||
server uptime-kuma:3001;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
# Status page location
|
||||
location /status {
|
||||
# Rate limiting
|
||||
|
||||
Reference in New Issue
Block a user