saving uncommitted changes in /etc prior to dnf run
This commit is contained in:
5
nginx/allowed_clients.config
Normal file
5
nginx/allowed_clients.config
Normal file
@@ -0,0 +1,5 @@
|
||||
geo $allowed_clients {
|
||||
default 0;
|
||||
192.168.1.0/24 1;
|
||||
188.26.227.57/32 1;
|
||||
}
|
||||
@@ -1,16 +1,22 @@
|
||||
# allow list
|
||||
|
||||
geo $allow {
|
||||
192.168.1.0/24 allowed;
|
||||
188.26.227.57/32 allowed;
|
||||
}
|
||||
# whitelisted clients
|
||||
include /etc/nginx/allowed_clients.config;
|
||||
|
||||
server {
|
||||
listen 192.168.1.2:80;
|
||||
server_name maintenance.898.ro;
|
||||
root /var/www/html/maintenance;
|
||||
index index.html;
|
||||
|
||||
access_log /var/log/nginx/maintenance.access.log;
|
||||
error_log /var/log/nginx/maintenance.error.log notice;
|
||||
|
||||
# maintenance error page
|
||||
include /etc/nginx/lb_maint_5x.config;
|
||||
|
||||
location / {
|
||||
# maintenance logic
|
||||
include /etc/nginx/lb_maintenance.config;
|
||||
|
||||
index index.html;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
5
nginx/lb_maint_5x.config
Normal file
5
nginx/lb_maint_5x.config
Normal file
@@ -0,0 +1,5 @@
|
||||
error_page 503 /maintenance.html;
|
||||
|
||||
location = /maintenance.html {
|
||||
root /var/www/html/maintenance;
|
||||
}
|
||||
13
nginx/lb_maintenance.config
Normal file
13
nginx/lb_maintenance.config
Normal file
@@ -0,0 +1,13 @@
|
||||
set $maintenance 0;
|
||||
|
||||
if (-f /var/www/html/maintenance/maintenance.html) {
|
||||
set $maintenance 1;
|
||||
}
|
||||
|
||||
if ($allowed_clients != 1) {
|
||||
set $maintenance "${maintenance}1";
|
||||
}
|
||||
|
||||
if ($maintenance = 11) {
|
||||
return 503;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
Reference in New Issue
Block a user