Merge pull request #10 from bdebyl/CU-1hwjcnt
CU-1hwjcnt Added home.bdebyl.net.conf for nginx (redirect external tr…
This commit is contained in:
@@ -6,6 +6,7 @@ deps: [
|
|||||||
]
|
]
|
||||||
|
|
||||||
ci_server_name: ci.bdebyl.net
|
ci_server_name: ci.bdebyl.net
|
||||||
|
home_server_name: home.bdebyl.net
|
||||||
install_path: /usr/share
|
install_path: /usr/share
|
||||||
|
|
||||||
nginx_path: /etc/nginx
|
nginx_path: /etc/nginx
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ http {
|
|||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_disable "mise6";
|
gzip_disable "mise6";
|
||||||
|
gzip_min_length 1000;
|
||||||
|
gzip_proxied expired no-cache no-store private auth;
|
||||||
|
gzip_types text/plain application/xml application/json application/javascript application/octet-stream text/css;
|
||||||
|
|
||||||
# client_body_buffer_size 1k;
|
# client_body_buffer_size 1k;
|
||||||
# client_header_buffer_size 1k;
|
# client_header_buffer_size 1k;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
file:
|
file:
|
||||||
path: "/etc/nginx/{{ item }}"
|
path: "/etc/nginx/{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0644
|
mode: 0755
|
||||||
loop:
|
loop:
|
||||||
- sites-enabled
|
- sites-enabled
|
||||||
- sites-available
|
- sites-available
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
mode: 0644
|
mode: 0644
|
||||||
loop:
|
loop:
|
||||||
- "{{ ci_server_name }}.http.conf"
|
- "{{ ci_server_name }}.http.conf"
|
||||||
|
- "{{ home_server_name }}.conf"
|
||||||
notify: restart_nginx
|
notify: restart_nginx
|
||||||
tags: http
|
tags: http
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
geo $whitelisted {
|
||||||
|
default 0;
|
||||||
|
192.168.1.1/24 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name {{ home_server_name }};
|
||||||
|
if ($whitelisted = 1) {
|
||||||
|
return 302 http://pi.hole;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($whitelisted = 0) {
|
||||||
|
return 302 $scheme://bdebyl.net$request_uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user