summaryrefslogtreecommitdiff
path: root/sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx.epp
blob: 87bdae72a5ec0940090ee47756bc6800608a48af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<%- | String $virtual_host,
      String $target,
      String $custom_config,
| -%>
# THIS FILE IS MANAGED BY PUPPET, MANUAL CHANGES WILL BE OVERWRITTEN AT THE
# NEXT PUPPET RUN.

server {
  listen 80;
  listen [::]:80;

  listen 443 ssl;
  listen [::]:443 ssl;

  if ($https != "on") {
    return 301 https://$host$uri;
  }

  ssl_certificate /etc/ssl/public/<%= $virtual_host %>.chain.pem;
  ssl_certificate_key /etc/ssl/private/<%= $virtual_host %>.key.pem;

  access_log /var/log/nginx/<%= $virtual_host %>.access.log;
  error_log /var/log/nginx/<%= $virtual_host %>.error.log;

  server_name <%= $virtual_host %>;
  <%= $custom_config -%>

  location / {
    proxy_pass <%= $target %>;
  }
}