various update
This commit is contained in:
5
defaults/main.yml
Normal file
5
defaults/main.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
nginx_http_port: 80
|
||||||
|
nginx_user: www-data
|
||||||
|
nginx_group: www-data
|
||||||
|
nginx_documentroot_default: /var/www/html
|
||||||
@@ -1,15 +1,20 @@
|
|||||||
---
|
---
|
||||||
- name: "nginx | copy status vhost"
|
- name: 'nginx | copy status vhost'
|
||||||
copy:
|
template:
|
||||||
src: "status.conf"
|
src: status.conf.j2
|
||||||
dest: "/etc/nginx/sites-available/00-status.conf"
|
dest: /etc/nginx/sites-available/00-status.conf
|
||||||
|
owner: root
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
force: yes
|
notify:
|
||||||
backup: yes
|
- 'nginx restart'
|
||||||
when: is_nginx
|
tags:
|
||||||
|
- nginx
|
||||||
|
- nginx_configure
|
||||||
|
|
||||||
- name: "nginx | activate the status vhost"
|
- name: "nginx | activate the status vhost"
|
||||||
file:
|
file:
|
||||||
src: "/etc/nginx/sites-available/00-status.conf"
|
src: "/etc/nginx/sites-available/00-status.conf"
|
||||||
dest: "/etc/nginx/sites-enabled/00-status.conf"
|
dest: "/etc/nginx/sites-enabled/00-status.conf"
|
||||||
state: link
|
state: link
|
||||||
|
notify:
|
||||||
|
- 'nginx restart'
|
||||||
@@ -52,18 +52,16 @@
|
|||||||
|
|
||||||
- name: 'nginx | configure nginx logs'
|
- name: 'nginx | configure nginx logs'
|
||||||
file:
|
file:
|
||||||
path: "/var/log/nginx/{{ item.value.servername }}"
|
path: "/var/log/nginx/{{ item.value.log_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
owner: root
|
||||||
group: adm
|
group: adm
|
||||||
loop: "{{ nginx_vhosts | dict2items }}"
|
loop: "{{ nginx_vhosts | dict2items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.value.servername | default([]) }}"
|
label: "{{ item.value.log_path | default([]) }}"
|
||||||
when:
|
when:
|
||||||
- nginx_vhosts is defined
|
- nginx_vhosts is defined
|
||||||
- item.value.enabled is undefined or item.value.enabled
|
- item.value.log_path is undefined or item.value.log_path
|
||||||
- item.value.documentroot is defined
|
|
||||||
- item.value.documentroot != False
|
|
||||||
notify:
|
notify:
|
||||||
- nginx reload
|
- nginx reload
|
||||||
tags:
|
tags:
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
server {
|
server {
|
||||||
listen 127.0.0.1:80;
|
listen 127.0.0.1:{{ nginx_http_port }};
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
access_log /var/log/nginx/localhost.access.log;
|
#access_log /var/log/nginx/localhost.access.log;
|
||||||
error_log /var/log/nginx/localhost.error.log;
|
#error_log /var/log/nginx/localhost.error.log;
|
||||||
|
|
||||||
location ~ /.well-known/acme-challenge/ {
|
location ~ /.well-known/acme-challenge/ {
|
||||||
alias /var/www/challenges/;
|
alias /var/www/challenges/;
|
||||||
@@ -19,13 +19,6 @@ server {
|
|||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
# location /php_status {
|
|
||||||
# access_log off;
|
|
||||||
# include /etc/nginx/fastcgi_params;
|
|
||||||
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
|
|
||||||
# fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
# }
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user