Permalink
Browse files

menage

  • Loading branch information...
1 parent ed0d406 commit 1aa499b9541676bfafbac31376950b380189bb6b @pad92 committed Nov 26, 2012
View
@@ -1,34 +0,0 @@
-fastcgi_param QUERY_STRING $query_string;
-fastcgi_param REQUEST_METHOD $request_method;
-fastcgi_param CONTENT_TYPE $content_type;
-fastcgi_param CONTENT_LENGTH $content_length;
-
-fastcgi_param SCRIPT_NAME $fastcgi_script_name;
-fastcgi_param REQUEST_URI $request_uri;
-fastcgi_param DOCUMENT_URI $document_uri;
-fastcgi_param DOCUMENT_ROOT $document_root;
-fastcgi_param SERVER_PROTOCOL $server_protocol;
-fastcgi_param HTTPS $https if_not_empty;
-
-fastcgi_param GATEWAY_INTERFACE CGI/1.1;
-fastcgi_param SERVER_SOFTWARE nginx;
-
-fastcgi_param REMOTE_ADDR $remote_addr;
-fastcgi_param REMOTE_PORT $remote_port;
-fastcgi_param SERVER_ADDR $server_addr;
-fastcgi_param SERVER_PORT $server_port;
-fastcgi_param SERVER_NAME $server_name;
-
-# PHP only, required if PHP was built with --enable-force-cgi-redirect
-fastcgi_param REDIRECT_STATUS 200;
-
-fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-# http://interfacelab.com/nginx-php-fpm-apc-awesome/
-fastcgi_connect_timeout 60;
-fastcgi_send_timeout 180;
-fastcgi_read_timeout 180;
-fastcgi_buffer_size 128k;
-fastcgi_buffers 4 256k;
-fastcgi_busy_buffers_size 256k;
-fastcgi_temp_file_write_size 256k;
-fastcgi_intercept_errors on;
@@ -1,4 +0,0 @@
-#location ~* \.(jpg|png|gif|jpeg|css|js|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
-# expires 24h;
-# log_not_found off;
-#}
@@ -1,4 +0,0 @@
-error_page 500 502 503 504 /50x.html;
-location = /50x.html {
- root /usr/local/www/nginx-dist;
-}
@@ -1 +0,0 @@
-access_log /var/log/nginx/$host-access.log;
@@ -1,19 +0,0 @@
-client_body_buffer_size 128k;
-#client_max_body_size 10M;
-proxy_buffer_size 16k;
-proxy_buffering on;
-proxy_buffers 32 4k;
-proxy_busy_buffers_size 64k;
-proxy_cache_min_uses 3;
-proxy_cache_valid any 10m;
-proxy_connect_timeout 60;
-proxy_ignore_client_abort off;
-proxy_ignore_headers Expires Cache-Control;
-proxy_intercept_errors on;
-proxy_next_upstream error timeout invalid_header;
-proxy_read_timeout 60;
-proxy_redirect off;
-proxy_send_timeout 60;
-proxy_set_header Host $host;
-proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-proxy_set_header X-Real-IP $remote_addr;
@@ -1,38 +0,0 @@
-## Only allow these request methods ##
-if ($request_method !~ ^(GET|HEAD|POST)$ ) {
- return 444;
-}
-## Do not accept DELETE, SEARCH and other methods ##
-
-location = /favicon.ico {
- empty_gif;
- log_not_found off;
- access_log off;
-}
-
-location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
-}
-
-location ~ /\. {
- deny all;
- access_log off;
- log_not_found off;
-}
-
-# http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html
-## Start: Size Limits & Buffer Overflows ##
-client_body_buffer_size 1K;
-client_header_buffer_size 1k;
-client_max_body_size 1m;
-large_client_header_buffers 2 1k;
-## END: Size Limits & Buffer Overflows ##
-
-## Deny certain Referers ###
-if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) )
-{
- return 403;
-}
-##
@@ -1,50 +0,0 @@
-# WP Super Cache rules.
-# Designed to be included from a 'wordpress-ms-...' configuration file.
-
-# Enable detection of the .gz extension for statically compressed content.
-# Comment out this line if static gzip support is not compiled into nginx.
-gzip_static on;
-
-set $supercacheuri "";
-set $supercachefile "$document_root/wp-content/cache/supercache/${http_host}${uri}index.html";
-if (-e $supercachefile) {
- set $supercacheuri "/wp-content/cache/supercache/${http_host}${uri}index.html";
-}
-
-# If this is a POST request, pass the request onto WordPress.
-if ($request_method = POST) {
- set $supercacheuri "";
-}
-
-# If there is a query string, serve the uncached version.
-if ($query_string) {
- set $supercacheuri "";
-}
-
-# Logged in users and those who have posted a comment get the non-cached version.
-if ($http_cookie ~* comment_author_|wordpress_logged_in|wp-postpass_) {
- set $supercacheuri "";
-}
-
-# Mobile browsers get the non-cached version.
-# Wastes CPU cycles if there isn't a mobile browser WP theme for the site.
-if ($http_x_wap_profile) {
- set $supercacheuri "";
-}
-
-if ($http_profile) {
- set $supercacheuri "";
-}
-
-if ($http_user_agent ~* (2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800)) {
- set $supercacheuri "";
-}
-
-if ($http_user_agent ~* (w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-)) {
- set $supercacheuri "";
-}
-
-# Stop processing if the supercache file is valid.
-if ($supercacheuri) {
- rewrite ^ $supercacheuri break;
-}
@@ -1,61 +0,0 @@
-# WordPress multisite subdirectory rules.
-# Designed to be included in any server {} block.
-
-# This order might seem weird - this is attempted to match last if rules below fail.
-# http://wiki.nginx.org/HttpCoreModule
-location / {
- try_files $uri $uri/ /index.php?$args;
-}
-
-# Add trailing slash to */wp-admin requests.
-rewrite /wp-admin$ $scheme://$host$uri/ permanent;
-
-# Directives to send expires headers and turn off 404 error logging.
-location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
- expires 24h;
- log_not_found off;
-}
-
-# Pass uploaded files to wp-includes/ms-files.php.
-rewrite /files/$ /index.php last;
-
-# For multisite: Use a caching plugin that creates symlinks to the correct subdirectory structure to get some performance gains.
-set $cachetest "$document_root/wp-content/cache/ms-filemap/${host}${uri}";
-if ($uri ~ /$) {
- set $cachetest "";
-}
-if (-f $cachetest) {
- # Rewrites the URI and stops rewrite processing so it doesn't start over and attempt to pass it to the next rule.
- rewrite ^ /wp-content/cache/ms-filemap/${host}${uri} break;
-}
-
-if ($uri !~ wp-content/plugins) {
- rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
-}
-
-# Uncomment one of the lines below for the appropriate caching plugin (if used).
-#include global/wordpress-ms-subdir-wp-super-cache.conf;
-#include global/wordpress-ms-subdir-w3-total-cache.conf;
-
-# Rewrite multisite '.../wp-.*' and '.../*.php'.
-if (!-e $request_filename) {
- rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
- rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last;
- rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
-}
-
-# Pass all .php files onto a php-fpm/php-fcgi server.
-location ~ \.php$ {
- # Zero-day exploit defense.
- # http://forum.nginx.org/read.php?2,88845,page=3
- # Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
- # Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine. And then cross your fingers that you won't get hacked.
- try_files $uri =404;
-
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include fastcgi_params;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-# fastcgi_intercept_errors on;
- fastcgi_pass php;
-}
@@ -1,61 +0,0 @@
-# WordPress multisite subdirectory rules.
-# Designed to be included in any server {} block.
-
-# This order might seem weird - this is attempted to match last if rules below fail.
-# http://wiki.nginx.org/HttpCoreModule
-location / {
- try_files $uri $uri/ /index.php?$args;
-}
-
-# Add trailing slash to */wp-admin requests.
-rewrite /wp-admin$ $scheme://$host$uri/ permanent;
-
-# Directives to send expires headers and turn off 404 error logging.
-location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
- expires 24h;
- log_not_found off;
-}
-
-# Pass uploaded files to wp-includes/ms-files.php.
-rewrite /files/$ /index.php last;
-
-# For multisite: Use a caching plugin that creates symlinks to the correct subdirectory structure to get some performance gains.
-set $cachetest "$document_root/wp-content/cache/ms-filemap/${host}${uri}";
-if ($uri ~ /$) {
- set $cachetest "";
-}
-if (-f $cachetest) {
- # Rewrites the URI and stops rewrite processing so it doesn't start over and attempt to pass it to the next rule.
- rewrite ^ /wp-content/cache/ms-filemap/${host}${uri} break;
-}
-
-if ($uri !~ wp-content/plugins) {
- rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
-}
-
-# Uncomment one of the lines below for the appropriate caching plugin (if used).
-#include global/wordpress-ms-subdir-wp-super-cache.conf;
-#include global/wordpress-ms-subdir-w3-total-cache.conf;
-
-# Rewrite multisite '.../wp-.*' and '.../*.php'.
-if (!-e $request_filename) {
- rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
- rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last;
- rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
-}
-
-# Pass all .php files onto a php-fpm/php-fcgi server.
-location ~ \.php$ {
- # Zero-day exploit defense.
- # http://forum.nginx.org/read.php?2,88845,page=3
- # Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
- # Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine. And then cross your fingers that you won't get hacked.
- try_files $uri =404;
-
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include fastcgi_params;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-# fastcgi_intercept_errors on;
- fastcgi_pass php;
-}
@@ -1,55 +0,0 @@
-location / {
- try_files $uri $uri/ /index.php?$args;
-}
-#if (!-e $request_filename) {
-# rewrite ^(.+)$ /index.php?q=$1 last;
-#}
-
-rewrite /wp-admin$ $scheme://$host$uri/ permanent;
-
-location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
- expires max;
- log_not_found off;
-}
-
-location /wp-includes/ {
- expires 7d;
-}
-location /wp-content/ {
- expires 14d;
-}
-
-# Uncomment one of the lines below for the appropriate caching plugin (if used).
-#include global/wordpress-wp-super-cache.conf;
-#include global/wordpress-w3-total-cache.conf;
-
-location /readme.html {
- return 404;
-}
-
-location ~* \.(php|inc)$ {
- if ($uri ~ "uploads") {
- return 403;
- }
- if (!-f $request_filename) {
- return 404;
- }
-
- if ($request_method = GET) {
- set $memcached_key $request_uri;
- memcached_pass mcache;
- error_page 404 = @wpnocache;
- }
- if ($request_method != GET) {
- fastcgi_pass php;
- }
-}
-
-location @wpnocache {
- try_files $uri =404;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include fastcgi_params;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_pass php;
-}
View
No changes.
Oops, something went wrong.

0 comments on commit 1aa499b

Please sign in to comment.