Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- ## Your website name goes here.
- server_name livefreedietravelling.com www.livefreedietravelling.com;
- ## Your only path reference.
- root /var/www/;
- listen 8080;
- ## This should be in your http block and if it is, it's not needed here.
- index index.html index.htm index.php;
- # added from http://calendar.perfplanet.com/2012/using-nginx-php-fpmapc-and-varnish-to-make-wordpress-websites-fly/ - 28th Dec 2012
- server_tokens off;
- autoindex off;
- client_max_body_size 15m;
- client_body_buffer_size 128k;
- expires 86400s;
- add_header Pragma public;
- add_header Cache-Control "max-age=86400, public, must-revalidate, proxy-revalidate";
- error_page 403 = 404;
- location ~ /(\.|wp-config.php|readme.html|licence.txt) {
- return 404;
- }
- rewrite /wp-admin$ $scheme://$host$uri/ permanent;
- location ~* ^.+\.(css|js)$ {
- rewrite ^(.+)\.(\d+)\.(css|js)$ $1.$3 last;
- expires 31536000s;
- access_log off;
- log_not_found off;
- add_header Pragma public;
- add_header Cache-Control "max-age=31536000, public";
- }
- location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|wri|xla|xls|xlsx|xlt|xlw|zip)$ {
- expires 360d;
- access_log off;
- log_not_found off;
- add_header Pragma public;
- add_header Cache-Control "max-age=31536000, public";
- }
- location ~* (^(?!(?:(?!(php|inc)).)*/uploads/).*?(php)) {
- try_files $uri = 404;
- fastcgi_split_path_info ^(.+.php)(.*)$;
- fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- fastcgi_intercept_errors on;
- fastcgi_ignore_client_abort off;
- fastcgi_connect_timeout 120;
- 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;
- }
- # added from http://phpbugs.wordpress.com/2012/10/29/nginx-upstream-timed-out-110-connection-timed-out-while-reading-response-header-from-upstream/
- proxy_read_timeout 120;
- include conf.d/drop;
- location / {
- # This is cool because no php is touched for static content
- try_files $uri $uri/ /index.php?q=$uri&$args;
- # Added to Rewrite TimThumb to Pretty URL so compatible with CDN
- rewrite ^/cdn-thumb/(.*)$ /wp-content/themes/sahifa/timthumb.php?$1 last;
- }
- # MAKE SURE TO UNCOMMENT IF ABOVE IMPORTED CONFIG DOES NOT WORK
- #
- # location ~ \.php$ {
- # fastcgi_buffers 8 256k;
- # fastcgi_buffer_size 128k;
- # fastcgi_intercept_errors on;
- # include fastcgi_params;
- # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- # fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
- #
- #
- # }
- # BEGIN Better WP Security
- set $susquery 0;
- set $rule_2 0;
- set $rule_3 0;
- if ($request_method ~* "^(TRACE|DELETE|TRACK)"){ return 403; }
- location /wp-comments-post.php {
- valid_referers jetpack.wordpress.com/jetpack-comment/ *.livefreedietravelling.com;
- set $rule_0 0;
- if ($request_method ~ "POST"){ set $rule_0 1$rule_0; }
- if ($invalid_referer) { set $rule_0 2$rule_0; }
- if ($http_user_agent ~ "^$"){ set $rule_0 3$rule_0; }
- if ($rule_0 = "3210") { return 403; }
- } if ($http_cookie !~* "wordpress_logged_in_" ) {
- set $susquery 2$susquery;
- set $rule_2 1;
- set $rule_3 1;
- }
- if ($args !~ "^loggedout=true") { set $susquery 3$susquery; }
- # END Better WP Security
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement