Make hubot nginx config generic
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
#
|
||||
# Generated by Chef
|
||||
upstream _express_schlupp {
|
||||
server localhost:<%= @express_port %>;
|
||||
#
|
||||
upstream _express_<%= @server_name.gsub(".", "_") %> {
|
||||
server localhost:<%= @express_port %>;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80; # For Let's Encrypt
|
||||
listen 80;
|
||||
server_name <%= @server_name %>;
|
||||
|
||||
# For Let's Encrypt ACME verification
|
||||
location /.well-known {
|
||||
root "/var/www/hubot.5apps.com";
|
||||
root "/var/www/<%= @server_name %>";
|
||||
}
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
@@ -23,14 +26,14 @@ server {
|
||||
|
||||
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;
|
||||
access_log <%= node[:nginx][:log_dir] %>/<%= @server_name %>.access.log json;
|
||||
error_log <%= node[:nginx][:log_dir] %>/<%= @server_name %>.error.log warn;
|
||||
|
||||
location / {
|
||||
# Increase number of buffers. Default is 8
|
||||
proxy_buffers 1024 8k;
|
||||
|
||||
proxy_pass http://_express_schlupp;
|
||||
proxy_pass http://_express_<%= @server_name.gsub(".", "_") %>;
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user