Files
chef/site-cookbooks/kosmos_gitea/templates/default/nginx_conf.erb
Greg Karékinian 55865c526c Add the Let's Encrypt hook dir to the config
Only enabled when there is no TLS cert. This is already part of the
certbot nginx vhost
2020-06-02 16:17:34 +02:00

33 lines
678 B
Plaintext

# Generated by Chef
upstream _gitea {
server localhost:<%= @upstream_port %>;
}
server {
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name <%= @server_name %>;
ssl_certificate <%= @ssl_cert %>;
ssl_certificate_key <%= @ssl_key %>;
add_header Strict-Transport-Security "max-age=31536000";
<% else -%>
listen 80;
server_name <%= @server_name %>;
location /.well-known {
root "/var/www/<%= @server_name %>";
}
<% end -%>
location / {
# Increase number of buffers. Default is 8
proxy_buffers 1024 8k;
proxy_pass http://_gitea;
proxy_http_version 1.1;
}
}