From: Alfredo Deza Date: Tue, 7 Jul 2015 13:23:39 +0000 (-0400) Subject: templates for nginx X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a20293dea3a603e0bff8618492fb7d33c47791d;p=ceph-build.git templates for nginx Signed-off-by: Alfredo Deza --- diff --git a/ansible/master/ansible-jenkins/templates/jenkins.conf b/ansible/master/ansible-jenkins/templates/jenkins.conf new file mode 100644 index 000000000..b01e34de8 --- /dev/null +++ b/ansible/master/ansible-jenkins/templates/jenkins.conf @@ -0,0 +1,22 @@ +# {{ ansible_managed }} + +server { + listen 80; + + # FIXME + server_name localhost; + + access_log /var/log/nginx/jenkins_access.log; + error_log /var/log/nginx/jenkins_error.log; + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_pass http://127.0.0.1:8080; + proxy_read_timeout 90; + + } +} diff --git a/ansible/master/ansible-jenkins/templates/nginx.conf b/ansible/master/ansible-jenkins/templates/nginx.conf new file mode 100644 index 000000000..1ab526efb --- /dev/null +++ b/ansible/master/ansible-jenkins/templates/nginx.conf @@ -0,0 +1,69 @@ +# {{ ansible_managed }} +user nginx; +worker_processes {{ nginx_processor_count }}; +worker_rlimit_nofile 8192; + +pid /var/run/nginx.pid; + +events { + worker_connections {{ nginx_connections }} ; + # multi_accept on; +} + +http { + + ## + # Basic Settings + ## + + #sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + server_tokens off; + + # server_names_hash_bucket_size 64; + # server_name_in_redirect off; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + ## + # Logging Settings + ## + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + ## + # Gzip Settings + ## + + gzip on; + gzip_disable "msie6"; + + # gzip_vary on; + # gzip_proxied any; + # gzip_comp_level 6; + # gzip_buffers 16 8k; + # gzip_http_version 1.1; + # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + + ## + # If HTTPS, then set a variable so it can be passed along. + ## + + map $scheme $server_https { + default off; + https on; + } + + ## + # Virtual Host Configs + ## + + include /etc/nginx/conf.d/*.conf; + include /etc/nginx/sites-enabled/*; +} + diff --git a/ansible/master/master.yml b/ansible/master/master.yml index 53ef2b821..23e9b1d6f 100644 --- a/ansible/master/master.yml +++ b/ansible/master/master.yml @@ -6,6 +6,8 @@ roles: - ansible-jenkins vars: + - nginx_processor_count: 20 + - nginx_connections: 2048 - ansible_ssh_port: 2222 - plugins: - 'ldap'