chef/site-cookbooks/5apps-hubot/templates/default/nginx_conf_hubot.5apps.com.erb

42 lines
970 B
Plaintext

# Generated by Chef
upstream _express_schlupp {
server localhost:<%= @express_port %>;
}
server {
listen 80; # For Let's Encrypt
server_name <%= @server_name %>;
location /.well-known {
root "/var/www/hubot.5apps.com";
}
location / {
return 301 https://$host$request_uri;
}
}
server {
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
listen 443 ssl http2;
add_header Strict-Transport-Security "max-age=15768000";
<% end -%>
server_name <%= @server_name %>;
access_log <%= node[:nginx][:log_dir] %>/hubot.5apps.com.access.log json;
error_log <%= node[:nginx][:log_dir] %>/hubot.5apps.com.error.log warn;
location / {
# Increase number of buffers. Default is 8
proxy_buffers 1024 8k;
proxy_pass http://_express_schlupp;
proxy_http_version 1.1;
}
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
ssl_certificate <%= @ssl_cert %>;
ssl_certificate_key <%= @ssl_key %>;
<% end -%>
}