The built-in rewrite rules of wordpress are related to apache. This article describes how to configure the rewrite rules of wordpress under nginx. First, configure a php upstream to facilitate backend machine and port changes, and then configure the corresponding blog domain name virtual machine. # The rewrite rules of Upstream... wordpress are all about apache. This article describes how to configure the wordpress rewrite rules under nginx. First, configure a php upstream to facilitate backend machine and port changes, and then configure the corresponding blog domain name virtual machine. # Upstream to abstract backend connection (s) for phpupstream php {server unix:/tmp/php-cgi.socket; server 127.0.0.1: 9000;} server {## Your website name goes here. server_name domain. tld; ## Your only path reference. root/var/www/wordpress; # This shoshould be in your http block and if it is, # it's not needed here. index. php; location =/favicon. ico {log_not_found off; access_log off;} l Ocation =/robots.txt {allow all; log_not_found off; access_log off;} location/{# This is cool because no php is touched for static content. # include "? $ Args "part so non-default permalinks doesn't # break when using query string try_files $ uri // index. php? $ Args;} location ~ \. Php $ {# NOTE: You shoshould have "cgi. fix_pathinfo = 0;" in php. ini include fastcgi. conf; fastcgi_intercept_errors on; fastcgi_pass php;} location ~ * \. (Js | css | png | jpg | jpeg | gif | ico) $ {expires max; log_not_found off ;}}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service