Skip to content

Instantly share code, notes, and snippets.

@a2f0
Last active October 14, 2016 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a2f0/eb93df4c02d971658d46f3a6a0ca2fa4 to your computer and use it in GitHub Desktop.
Save a2f0/eb93df4c02d971658d46f3a6a0ca2fa4 to your computer and use it in GitHub Desktop.
/etc/httpd/conf.d/{{ pillar['fqdn'] }}-ssl.conf:
apache.configfile:
- config:
- VirtualHost:
this: '*:443'
SSLEngine: 'on'
Header: set Access-Control-Allow-Origin "https://{{ pillar['fqdn'] }}"
SSLCertificateFile: /opt/certbot/config/live/{{ pillar['fqdn'] }}/cert.pem
SSLCertificateKeyFile: /opt/certbot/config/live/{{ pillar['fqdn'] }}/privkey.pem
SSLCertificateChainFile: /opt/certbot/config/live/{{ pillar['fqdn'] }}/fullchain.pem
SSLProtocol: all -SSLv2
SSLCipherSuite: ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
ServerName:
- {{ pillar['fqdn'] }}
ServerAlias:
- {{ pillar['fqdn2'] }}
ErrorLog: logs/{{ pillar['fqdn'] }}-ssl-error_log
CustomLog: logs/{{ pillar['fqdn'] }}-ssl-access_log combined
DocumentRoot: /opt/code/somesite/public
PassengerRuby: /usr/local/rbenv/versions/2.3.0/bin/ruby
PassengerMinInstances: 3
PassengerPreStart: https://{{ pillar['fqdn'] }}
RailsEnv: {{ pillar['environment'] }}
AddType:
- image/svg+xml svg svgz
AddEncoding:
- gzip svgz
Directory:
this: /opt/code/somesite/public
Allow from:
- all
Options:
- -MultiViews
Require:
- all granted
Location:
this: /assets/
RewriteEngine: on
RewriteCond: '%{HTTP:Accept-Encoding} \b(x-)?gzip\b'
RewriteCond: '%{REQUEST_FILENAME}.gz -s'
RewriteRule: ^(.+) $1.gz [L]
FilesMatch:
this: \.css\.gz$
ForceType: text/css
Header: set Content-Encoding gzip
FilesMatch:
this: \.js\.gz$
ForceType: text/javascript
Header: set Content-Encoding gzip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment