Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@
webui_hosts = new_resource.hosts
routes = local_routes()
cdomain = new_resource.cdomain
nginx_segment_max_timeout = new_resource.nginx_segment_max_timeout
nginx_segment_file_size = new_resource.nginx_segment_file_size

service 'nginx' do
service_name 'nginx'
Expand All @@ -767,7 +769,7 @@
group 'nginx'
mode '0644'
cookbook 'webui'
variables(webui_hosts: webui_hosts, webui_port: webui_port, cdomain: cdomain)
variables(webui_hosts: webui_hosts, webui_port: webui_port, cdomain: cdomain, nginx_segment_file_size: nginx_segment_file_size, nginx_segment_max_timeout: nginx_segment_max_timeout)
notifies :restart, 'service[nginx]'
end

Expand Down
2 changes: 2 additions & 0 deletions resources/resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
attribute :auth_mode, kind_of: String, default: 'database'
attribute :webui_version, kind_of: String
attribute :redborder_version, kind_of: String
attribute :nginx_segment_file_size, kind_of: String, default: '512'
attribute :nginx_segment_max_timeout, kind_of: String, default: '90'
attribute :user_sensor_map, kind_of: String, default: ''
attribute :s3_secrets, kind_of: Hash, default: {}
attribute :s3_malware_secrets, kind_of: Hash, default: {}
Expand Down
48 changes: 48 additions & 0 deletions resources/templates/default/webui.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,54 @@ server {
proxy_cache_valid 404 1m;
}

location /monitor/export_segments {
proxy_redirect http://webui /;
proxy_pass http://webui;

client_max_body_size <%= @nginx_segment_file_size %>m;
proxy_connect_timeout <%= @nginx_segment_max_timeout %>;
proxy_send_timeout <%= @nginx_segment_max_timeout %>;
proxy_read_timeout <%= @nginx_segment_max_timeout %>;

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;
}

location /monitor/import_segments {
proxy_redirect http://webui /;
proxy_pass http://webui;

client_max_body_size <%= @nginx_segment_file_size %>m;
proxy_connect_timeout <%= @nginx_segment_max_timeout %>;
proxy_send_timeout <%= @nginx_segment_max_timeout %>;
proxy_read_timeout <%= @nginx_segment_max_timeout %>;

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;
}

location /monitor/bulk_delete_segments {
proxy_redirect http://webui /;
proxy_pass http://webui;

client_max_body_size <%= @nginx_segment_file_size %>m;
proxy_connect_timeout <%= @nginx_segment_max_timeout %>;
proxy_send_timeout <%= @nginx_segment_max_timeout %>;
proxy_read_timeout <%= @nginx_segment_max_timeout %>;

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;
}

location / {
proxy_redirect http://webui /;
proxy_pass http://webui;
Expand Down