Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- root /usr/share/nginx/html/xxxxxxx;
- index index.php index.html index.htm;
- server_name xxxxxxxx www.xxxxxxx;
- access_log /var/log/nginx/hypoxico.ru.access.log;
- error_log /var/log/nginx/hypoxico.ru.error.log;
- #SEO for xml-sitemap
- rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
- rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
- location / {
- try_files $uri $uri/ /index.php?q=$uri&$args;
- }
- gzip on;
- gzip_http_version 1.1;
- gzip_vary on;
- gzip_comp_level 6;
- gzip_proxied any;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
- gzip_buffers 16 8k;
- gzip_disable "MSIE [1-6]\.(?!.*SV1)";
- ########test
- # Ensure requests for pagespeed optimized resources go to the pagespeed handler
- # and no extraneous headers get set.
- location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
- add_header "" "";
- }
- location ~ "^/pagespeed_static/" { }
- location ~ "^/ngx_pagespeed_beacon$" { }
- # Google Analytics Proxy
- rewrite ^/ga.js$ /ga/ last;
- location /ga/ {
- proxy_pass http://www.google-analytics.com/ga.js;
- break;
- }
- ##########test
- error_page 404 /404.html;
- error_page 500 502 503 504 /50x.html;
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- location ~ \.php$ {
- try_files $uri =404;
- fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/xxxxxxx$fastcgi_script_name;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- }
- location ~ /\.ht {
- deny all;
- }
- autoindex off;
- auth_basic_user_file /etc/nginx/htpasswd;
- # Disallow access to important files
- location ~* (/\.|wp-config.php|(?<!robots)\.txt|(liesmich|readme).*) {
- return 444;
- }
- # Auth protection xmlrpc.php
- location = /xmlrpc.php {
- auth_basic "Restricted Admin-Area";
- auth_basic_user_file /etc/nginx/htpasswd;
- }
- # Disable direct access of any *.php files in /wp_includes folder
- location ~ ^/wp-includes/.+\.php$ {
- return 444;
- }
- # Disable direct access of any *.php in /wp_content folder
- location ~ ^/wp-content/.+\.php$ {
- return 444;
- }
- # Disable direct access of any *.php in /wp_content/uploads folder
- location ~ ^/wp-content/uploads/.+\.php$ {
- return 444;
- }
- location ~* ^.+.(js|css|png|jpg|jpeg|gif|ico|htm|html|woff)$
- {
- expires 30d;
- }
- pagespeed on;
- pagespeed InPlaceResourceOptimization off;
- pagespeed DownstreamCachePurgeLocationPrefix http://localhost:80/;
- #pagespeed ModPagespeedModifyCachingHeaders off;
- pagespeed EnableFilters extend_cache;
- include blacklist.conf;
- # Defer and minify Javascript
- pagespeed EnableFilters defer_javascript;
- pagespeed EnableFilters rewrite_javascript;
- pagespeed EnableFilters combine_javascript;
- pagespeed EnableFilters canonicalize_javascript_libraries;
- # Inline and minimize css
- pagespeed EnableFilters rewrite_css;
- pagespeed EnableFilters fallback_rewrite_css_urls;
- # Loads CSS faster
- #pagespeed EnableFilters move_css_above_scripts;
- pagespeed EnableFilters move_css_to_head;
- # remove tags with default attributes
- pagespeed EnableFilters elide_attributes;
- #pagespeed PreserveUrlRelativity on;
- pagespeed RespectVary off;
- pagespeed DisableRewriteOnNoTransform off;
- pagespeed LowercaseHtmlNames on;
- pagespeed RewriteLevel PassThrough;
- pagespeed EnableFilters combine_css,extend_cache;
- pagespeed EnableFilters rewrite_css,rewrite_javascript;
- ############### test ###############
- open_file_cache max=200000 inactive=14d;
- open_file_cache_valid 1m;
- open_file_cache_min_uses 2;
- open_file_cache_errors on;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement