Role service-nginx: add nginx.conf templating

This commit is contained in:
Tobias Hachmer 2017-12-29 20:31:46 +01:00
parent a2104ddcc5
commit 7757387dd5
3 changed files with 41 additions and 0 deletions

View file

@ -4,6 +4,7 @@ Diese Ansible role installiert und konfiguriert den Web Server nginx.
- installiert das offizielle Debian Repository von nginx.org
- installiert nginx
- schreibt nginx.conf
- schreibt default.conf
- installiert die Standard MWU Gateway Webseite

View file

@ -20,6 +20,15 @@
name: nginx
state: present
- name: write nginx configuration nginx.conf
template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
mode: 0644
owner: root
group: root
notify: reload nginx
- name: write nginx configuration default.conf
template:
src: default.conf.j2

View file

@ -0,0 +1,31 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
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;
access_log off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
}