diff --git a/defaults/main.yaml b/defaults/main.yaml index b2ba697..3949daf 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -19,4 +19,4 @@ nginx_file_include_dir_owner: "{{ ansible_user }}" nginx_file_include_dir_src: "" nginx_file_nginx_conf_dest: /etc/nginx/nginx.conf -nginx_file_nginx_conf_src: etc/nginx/nginx.conf +nginx_file_nginx_conf_src: "" diff --git a/files/etc/nginx/nginx.conf b/files/etc/nginx/nginx.conf deleted file mode 100644 index 6a94b90..0000000 --- a/files/etc/nginx/nginx.conf +++ /dev/null @@ -1,30 +0,0 @@ -user nginx; -worker_processes auto; -error_log /var/log/nginx/error.log; -pid /run/nginx.pid; - -events { - worker_connections 1024; -} - -http { - 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; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - # Load modular configuration files from the /etc/nginx/conf.d directory. - # See http://nginx.org/en/docs/ngx_core_module.html#include - # for more information. - include /etc/nginx/conf.d/*.conf; -} diff --git a/tasks/config.yaml b/tasks/config.yaml index 47f97ef..aa7b70e 100644 --- a/tasks/config.yaml +++ b/tasks/config.yaml @@ -16,6 +16,7 @@ copy: dest: "{{ nginx_file_nginx_conf_dest }}" src: "{{ nginx_file_nginx_conf_src }}" + when: nginx_file_nginx_conf_src != "" notify: - Validate nginx - Restart nginx