chef/site-cookbooks/kosmos-akkounts/templates/nginx_conf_akkounts-api.erb
Greg Karékinian 185982ff9f Add the initial kosmos-akkounts cookbook to deploy akkounts-api
Includes a recipe to set up nginx as a reverse proxy with a TLS
certificate for api.accounts.kosmos.org

Closes #18
Closes #20
2019-10-17 14:56:48 +02:00

36 lines
776 B
Plaintext

# Generated by Chef
upstream _akkounts {
server localhost:<%= @port %>;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
listen 443 ssl http2;
add_header Strict-Transport-Security "max-age=15768000";
ssl_certificate <%= @ssl_cert %>;
ssl_certificate_key <%= @ssl_key %>;
<% else -%>
listen 80;
<% end -%>
server_name <%= @server_name %>;
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://_akkounts;
proxy_http_version 1.1;
}
}