map $http_x_forwarded_proto $fe_https { default $https; https on; } server { listen 80 default_server; client_max_body_size 10m; root /var/www/html; include w3tc; index index.html index.php; server_name _; location @handler { rewrite /(.*) /index.php?path=$1&$query_string last; } location / { try_files $uri $uri/ @handler; } rewrite /wp-admin$ $scheme://$host$uri/ permanent; location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; } location ~ \.php$ { include fastcgi_params; include fastcgi.d/*; fastcgi_pass 127.0.0.1:9000; } location ~ /\.ht { deny all; } charset UTF-8; # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }