-
-
Save pricejn2/09a4e65fca590255b507 to your computer and use it in GitHub Desktop.
Wordpress nginx include file for BOA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################### | |
### nginx.conf site wp vhost include start | |
####################################################### | |
### | |
### deny crawlers without 403 response | |
### | |
if ($http_user_agent ~* (HTTrack|HTMLParser|libwww|wget) ) { | |
return 444; | |
} | |
### | |
### deny access to .htaccess | |
### | |
location ~ \.htaccess$ { | |
deny all; | |
} | |
### | |
### catch all unspecified requests | |
### | |
location / { | |
try_files $uri $uri/ @wordpress; | |
} | |
### | |
### send all not cached requests to wordpress with clean URLs support | |
### | |
location @wordpress { | |
rewrite . /index.php last; | |
} | |
### | |
### send all non-static requests to php-fpm | |
### | |
location ~ \.php$ { | |
try_files $uri @wordpress; ### check for existence of php file first | |
fastcgi_pass unix:/var/run/www56.fpm.socket; ### /var/run/$pool.fpm.socket | |
} | |
### | |
### serve & no-log static files & images directly, without all standard drupal rewrites, php-fpm etc. | |
### | |
location ~* ^.+\.(jpg|jpeg|gif|png|ico|swf|pdf|doc|xls|tiff|tif|txt|shtml|cgi|bat|pl|dll|asp|exe|class|css|js)$ { | |
access_log off; | |
expires 30d; | |
try_files $uri =404; | |
} | |
### | |
### serve & log bigger media/static/archive files directly, without all standard drupal rewrites, php-fpm etc. | |
### | |
location ~* ^.+\.(avi|mpg|mpeg|mov|wmv|mp3|mp4|m4a|flv|wav|midi|zip|gz|rar)$ { | |
expires 30d; | |
try_files $uri =404; | |
} | |
### | |
### make feeds compatible with boost caching and set correct mime type - nginx 0.7.27 or newer required with try_files support | |
### | |
location ~* \.xml$ { | |
charset utf-8; | |
types { } | |
default_type application/rss+xml; | |
try_files $uri @wordpress; | |
} | |
####################################################### | |
### nginx.conf site wp vhost include end | |
####################################################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment