Role service-nginx: add nginx.conf templating
This commit is contained in:
parent
a2104ddcc5
commit
7757387dd5
3 changed files with 41 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
31
roles/service-nginx/templates/nginx.conf.j2
Normal file
31
roles/service-nginx/templates/nginx.conf.j2
Normal 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;
|
||||
}
|
Loading…
Reference in a new issue