Skip to content

Instantly share code, notes, and snippets.

@jwhulette
Last active April 2, 2018 18:03
Show Gist options
  • Save jwhulette/99a5615d23a2ef58981a6dc05f7d7cd4 to your computer and use it in GitHub Desktop.
Save jwhulette/99a5615d23a2ef58981a6dc05f7d7cd4 to your computer and use it in GitHub Desktop.
[Apache Vhost] #apache
DocumentRoot /usr/local/www/apache24/data/public
ServerName vagrant.local
AccessFileName .htaccess-dev
DirectoryIndex /index.php index.php
# Defining a worker will improve performance
# And in this case, re-use the worker (dependent on support from the fcgi application)
# If you have enough idle workers, this would only improve the performance marginally
<Proxy "fcgi://localhost:9000/" enablereuse=on max=10>
</Proxy>
<FilesMatch "\.php$">
<If "-f %{REQUEST_FILENAME}">
# Pick one of the following approaches
# Use the standard TCP socket
SetHandler "proxy:fcgi://localhost/:9000"
# If your version of httpd is 2.4.9 or newer (or has the back-ported feature), you can use the unix domain socket
#SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/"
</If>
</FilesMatch>
<Directory /usr/local/www/apache24/data/public>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
## EXPIRES HEADER CACHING ##
<IfModule mod_expires.c>
# Fonts
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
AddType image/svg+xml .svg
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType image/ico "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/css "now plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType application/x-font-opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType text/html "access plus 600 seconds"
ExpiresDefault "access plus 2 days"
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment