bundles/nginx: add nginx config
This commit is contained in:
parent
411d22d404
commit
ffb962b108
4 changed files with 76 additions and 1 deletions
35
bundles/nginx/files/nginx.conf
Normal file
35
bundles/nginx/files/nginx.conf
Normal file
|
@ -0,0 +1,35 @@
|
|||
user www-data;
|
||||
worker_processes ${worker_processes};
|
||||
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections ${worker_connections};
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
charset UTF-8;
|
||||
override_charset on;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 15;
|
||||
client_body_timeout 12;
|
||||
client_header_timeout 12;
|
||||
send_timeout 10;
|
||||
|
||||
access_log off;
|
||||
error_log off;
|
||||
|
||||
client_body_buffer_size 10K;
|
||||
client_header_buffer_size 1k;
|
||||
client_max_body_size 8m;
|
||||
large_client_header_buffers 2 1k;
|
||||
|
||||
include /etc/nginx/sites/*;
|
||||
}
|
13
bundles/nginx/files/port80.conf
Normal file
13
bundles/nginx/files/port80.conf
Normal file
|
@ -0,0 +1,13 @@
|
|||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
alias /var/www/default/.well-known/acme-challenge/;
|
||||
}
|
||||
}
|
23
bundles/nginx/items.py
Normal file
23
bundles/nginx/items.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
files = {
|
||||
'/etc/nginx/nginx.conf': {
|
||||
'content_type': 'mako',
|
||||
'context': node.metadata['nginx'],
|
||||
'triggers': {
|
||||
'svc_systemd:nginx:restart',
|
||||
},
|
||||
},
|
||||
'/etc/nginx/sites/000-port80.conf': {
|
||||
'source': 'port80.conf',
|
||||
'triggers': {
|
||||
'svc_systemd:nginx:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'nginx': {
|
||||
'needs': {
|
||||
'pkg_apt:nginx',
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
@metadata_processor
|
||||
def nginx_apt_repo(metadata):
|
||||
def defaults(metadata):
|
||||
return {
|
||||
'apt': {
|
||||
'repos': {
|
||||
|
@ -19,4 +19,8 @@ def nginx_apt_repo(metadata):
|
|||
'nginx': {},
|
||||
},
|
||||
},
|
||||
'nginx': {
|
||||
'worker_processes': 4,
|
||||
'worker_connections': 1000,
|
||||
},
|
||||
}, DEFAULTS, DONE
|
||||
|
|
Loading…
Reference in a new issue