-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from redBorder/bugfix/#19144_missing_nginx_con…
…fd_files Add balancing
- Loading branch information
Showing
5 changed files
with
141 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# Cookbook:: nginx | ||
# Resource:: config | ||
|
||
actions :add, :add_s3, :add_erchef, :add_aioutliers, :configure_certs, :remove, :register, :deregister | ||
actions :add, :add_http2k, :add_s3, :add_erchef, :add_aioutliers, :configure_certs, :remove_http2k, :remove_aioutliers, :remove, :register, :deregister | ||
default_action :add | ||
|
||
attribute :user, kind_of: String, default: 'nginx' | ||
attribute :s3_port, kind_of: Integer, default: 9000 | ||
attribute :http2k_port, kind_of: Integer, default: 9000 | ||
attribute :http2k_hosts, kind_of: Array | ||
attribute :s3_port, kind_of: Integer, default: 7980 | ||
attribute :s3_hosts, kind_of: Array, default: ['localhost:9000'] | ||
attribute :erchef_hosts, kind_of: Array | ||
attribute :erchef_port, kind_of: Integer, default: 4443 | ||
attribute :aioutliers_hosts, kind_of: Array | ||
attribute :aioutliers_port, kind_of: Integer, default: 39091 | ||
attribute :cdomain, kind_of: String, default: 'redborder.cluster' | ||
attribute :service_name, kind_of: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#################################################### | ||
## Generated by Chef for <%= node["hostname"] %> | ||
#################################################### | ||
|
||
upstream http2k { | ||
<% @http2k_hosts.each do |http2k_host| %> | ||
<% if http2k_host == "#{node['name']}.#{node['redborder']['cdomain']}" %> | ||
server 127.0.0.1:<%= @http2k_port %> weight=6 max_fails=3 fail_timeout=5s; | ||
<% else %> | ||
server <%=http2k_host%>:<%= @http2k_port %> weight=4 max_fails=3 fail_timeout=120; | ||
<% end %> | ||
<% end %> | ||
} | ||
|
||
server { | ||
listen 443 ssl http2; | ||
listen [::]:443 ssl http2; | ||
|
||
server_name http2k.service. .http2k.service; | ||
|
||
ssl_certificate /etc/nginx/ssl/http2k.crt; | ||
ssl_certificate_key /etc/nginx/ssl/http2k.key; | ||
ssl_session_timeout 10m; | ||
ssl_protocols TLSv1.2; | ||
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; | ||
ssl_prefer_server_ciphers on; | ||
access_log /var/log/nginx/access.log main; | ||
|
||
client_max_body_size 512m; | ||
|
||
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 https; | ||
proxy_pass_request_headers on; | ||
proxy_connect_timeout 90; | ||
proxy_send_timeout 90; | ||
proxy_read_timeout 90; | ||
|
||
proxy_buffer_size 128k; | ||
proxy_buffers 4 256k; | ||
proxy_busy_buffers_size 256k; | ||
proxy_temp_file_write_size 256k; | ||
|
||
location / { | ||
proxy_redirect http://http2k /; | ||
proxy_pass http://http2k; | ||
} | ||
} |