ServerName www.<%= node['app']['domain'] %>
Redirect permanent / http://<%= node['app']['domain'] %>/
<% if node['web']['do_ssl'] %>
ServerName www.<%= node['app']['domain'] %>
Redirect permanent / https://<%= node['app']['domain'] %>/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/<%= node['app']['domain'] %>/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/<%= node['app']['domain'] %>/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/<%= node['app']['domain'] %>/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/<%= node['app']['domain'] %>/privkey.pem
SetHandler server-status
Order Deny,Allow
Allow from all
SetHandler server-info
Order Deny,Allow
Allow from all
<% else %>
<% end %>
ServerName <%= node['app']['domain'] %>
ExpiresActive On
ExpiresDefault "access plus 1 week"
<% if node['web']['root'] %>
DocumentRoot <%= node['web']['root'] %>
/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
<% end -%>
<% if node['web']['static'] %>
<% node['web']['static'].each do |static| -%>
Alias <%= static['uri'] %> <%= node['working-dir'] %>/<%= static['path'] %>
<% end -%>
<% end -%>
<% if node['web']['wsgi'] %>
WSGIDaemonProcess <%= node['app']['name'] %> python-path=<%= node['python']['working-dir'] %> python-home=<%= node['python']['env_path'] %>
WSGIProcessGroup <%= node['app']['name'] %>
WSGIScriptAlias / <%= node['working-dir'] %>/<%= node['web']['wsgi']['wsgi_path'] %>
">
Require all granted
<% end %>
<% if node['web']['socket.io'] %>
# socket.io conf
RewriteEngine On
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .* ws://<%= node['web']['socket.io']['host']%>:<%= node['web']['socket.io']['port']%>%{REQUEST_URI} [P]
RewriteCond %{REQUEST_URI} ^/socket.io/$1/websocket [NC]
RewriteRule socket.io/(.*) ws://<%= node['web']['socket.io']['host']%>:<%= node['web']['socket.io']['port']%>/socket.io/$1 [P,L]
ProxyPass /socket.io http://<%= node['web']['socket.io']['host']%>:<%= node['web']['socket.io']['port']%>/socket.io
ProxyPassReverse /socket.io http://<%= node['web']['socket.io']['host']%>:<%= node['web']['socket.io']['port']%>/socket.io
<% end %>