Skip to content

Instantly share code, notes, and snippets.

@deajan
Created May 6, 2015 17:01
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 deajan/24882b86d55ecab3dfa2 to your computer and use it in GitHub Desktop.
Save deajan/24882b86d55ecab3dfa2 to your computer and use it in GitHub Desktop.
npvhost
<VirtualHost XX.XX.XX.XX:80>
DocumentRoot /home/www/myhost.tld/ftp/www
ServerName myhost.tld
ServerAlias www.myhost.tld
#ServerAdmin contact@myhost.tld
<Directory "/home/www/myhost.tld/ftp/www">
Require all granted
DirectoryIndex index.php index.html index.htm
AllowOverride All
</Directory>
### php-fpm
<IfModule event.c>
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php-fpm.myhost.tld.socket|fcgi://localhost/"
</FilesMatch>
</ifModule>
### Mod pagespeed not rewrite
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} !\.pagespeed\.
</ifModule>
### Compression
<IfModule mod_deflate.c>
<IfModule mod_mime.c>
Addtype font/truetype .ttf
Addtype font/opentype .otf
</IfModule>
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript image/svg+xml application/javascript application/xml application/xhtml+xml application/rss+xml application/javascript
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:pdf|avi|mov|mp3|mp4|rm)$ no-gzip dont-vary
# Proxies
Header append Vary User-Agent env=!dont-vary
</IfModule>
### Logs
CustomLog /var/log/httpd/myhost.tld.access.log combined
ErrorLog /var/log/httpd/myhost.tld.error.log
#Loglevel alert rewrite:trace3
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment