Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Alex Kotov | 8677fabf60 | |
Alex Kotov | da39b240d1 | |
Alex Kotov | 9d4a1da53b | |
Alex Kotov | f99c2fc0bc | |
Alex Kotov | 10ef6f10c5 | |
Alex Kotov | 00c7f572f0 | |
Alex Kotov | 24b8e5eff5 |
|
@ -4,3 +4,7 @@ nginx__remove_default: true
|
|||
nginx__upstreams: []
|
||||
nginx__sites: []
|
||||
nginx__stream: ''
|
||||
|
||||
nginx__geoip_country: null
|
||||
nginx__geoip_city: null
|
||||
nginx__geoip2: []
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width,
|
||||
initial-scale=1,
|
||||
maximum-scale=1,
|
||||
shrink-to-fit=no,
|
||||
user-scalable=no"/>
|
||||
|
||||
<title>Blocked in Russia</title>
|
||||
|
||||
<style>
|
||||
.center-text { text-align: center; }
|
||||
.center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.responsive {
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="center-text">
|
||||
Blocked in Russia
|
||||
</h1>
|
||||
|
||||
<p class="center-text">
|
||||
This information is illegal in Russia.
|
||||
</p>
|
||||
|
||||
<img
|
||||
src="/roskomnadzor.jpg"
|
||||
class="center responsive"
|
||||
alt="Roskomnadzor-chan"/>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Before Width: | Height: | Size: 305 KiB |
|
@ -1,7 +1,12 @@
|
|||
---
|
||||
- name: Install Nginx
|
||||
notify: nginx | Restart Nginx
|
||||
apt:
|
||||
name: nginx
|
||||
name:
|
||||
- libnginx-mod-http-geoip
|
||||
- libnginx-mod-http-geoip2
|
||||
- libnginx-mod-stream
|
||||
- nginx
|
||||
|
||||
- name: Create directories for Nginx configuration
|
||||
notify: nginx | Restart Nginx
|
||||
|
@ -39,6 +44,15 @@
|
|||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Install Nginx configs
|
||||
notify: nginx | Restart Nginx
|
||||
template:
|
||||
src: 'templates/conf.d/geoip.conf'
|
||||
dest: '{{ nginx__confd_dir }}/geoip.conf'
|
||||
mode: 'u=rw,go=r'
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Install Nginx stream config
|
||||
notify: nginx | Restart Nginx
|
||||
copy:
|
||||
|
@ -96,17 +110,14 @@
|
|||
with_items:
|
||||
- 'maintenance.html'
|
||||
- 'maintenance.jpg'
|
||||
- 'roskomnadzor.html'
|
||||
- 'roskomnadzor.jpg'
|
||||
|
||||
- name: Install additional snippets
|
||||
notify: nginx | Restart Nginx
|
||||
template:
|
||||
src: 'templates/{{ item }}.conf'
|
||||
src: 'templates/snippets/{{ item }}.conf'
|
||||
dest: '{{ nginx__snippets_dir }}/{{ item }}.conf'
|
||||
mode: 'u=rw,go=r'
|
||||
owner: root
|
||||
group: root
|
||||
with_items:
|
||||
- 'maintenance'
|
||||
- 'roskomnadzor'
|
||||
|
|
|
@ -4,9 +4,13 @@
|
|||
state: absent
|
||||
purge: true
|
||||
name:
|
||||
- libnginx-mod-http-geoip
|
||||
- libnginx-mod-http-geoip2
|
||||
- libnginx-mod-stream
|
||||
- nginx
|
||||
- nginx-common
|
||||
- nginx-core
|
||||
- nginx-full
|
||||
|
||||
- name: Delete Nginx configuration
|
||||
file:
|
||||
|
@ -20,5 +24,3 @@
|
|||
with_items:
|
||||
- 'maintenance.html'
|
||||
- 'maintenance.jpg'
|
||||
- 'roskomnadzor.html'
|
||||
- 'roskomnadzor.jpg'
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
state: absent
|
||||
purge: false
|
||||
name:
|
||||
- libnginx-mod-http-geoip
|
||||
- libnginx-mod-http-geoip2
|
||||
- libnginx-mod-stream
|
||||
- nginx
|
||||
- nginx-common
|
||||
- nginx-core
|
||||
- nginx-full
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
{% if nginx__geoip_country %}
|
||||
geoip_country {{ nginx__geoip_country }};
|
||||
{% else %}
|
||||
#geoip_country path/to/GeoIP.dat;
|
||||
{% endif %}
|
||||
{% if nginx__geoip_city %}
|
||||
geoip_city {{ nginx__geoip_city }};
|
||||
{% else %}
|
||||
#geoip_city path/to/GeoLiteCity.dat;
|
||||
{% endif %}
|
||||
{% for geoip2 in nginx__geoip2 %}
|
||||
|
||||
geoip2 {{ geoip2.file }} {
|
||||
{% if geoip2.auto_reload | default(False) %}
|
||||
auto_reload {{ geoip2.auto_reload }};
|
||||
{% endif %}
|
||||
{% for map in geoip2.maps %}
|
||||
${{ map.var }} {{ map.path }};
|
||||
{% endfor %}
|
||||
}
|
||||
{% endfor %}
|
|
@ -1,2 +0,0 @@
|
|||
location @roskomnadzor { root {{ nginx__dir_www_html }}; try_files /roskomnadzor.html roskomnadzor.html; }
|
||||
location = /roskomnadzor.jpg { root {{ nginx__dir_www_html }}; }
|
Loading…
Reference in New Issue