WordPress 502 Bad Gateway Solution
The first is to change several configurations of the PHP-FPM:
/www/wdlinux/php/etc/php-fpm.conf
/www/wdlinux/etc/php-fpm.conf Max_children from the previous 10 to the current 30, so that there is sufficient php-cgi process can be used;Change the request_terminate_timeout from the previous 0s to 60s, so that the php-cgi process script timeout is 60 seconds, preventing the process from being suspended and increasing
Start the iptables website in the Centos + nginx + wordpress environment and return the 502 iptables nginx fastCGI
Website environment: Centos nginx php (wordpress)
The problem is summarized as follows:
When the iptables website is started, 502 is returned, and the iptable
Nothing this afternoon, like the previous start to do SEO optimization, of course, involving to a permanent link, WordPress offers a variety of types of link form
1/%year%/%monthnum%/%day%/%postname%/
2/%year%/%monthnum%/%postname%/
3/%year%/%monthnum%/%day%/%postname%.html
4/%year%/%monthnum%/%postname%.html
5/%category%/%postname%.html
6/%post_id%.html
7/%postname%/
I chose the/%postname%.html, pseudo static, although now seemingly no differ
Because there are some different from the Apache rules, we can't use Apache's WordPress rules directly.
Crap not say more directly on the code
The code is as follows
Copy Code
[Root@localhost ~]# cat/etc/nginx/wprw.confRewrite ^.*/files/(. *) $/wp-includes/ms-files.php?file=$1 last;if (!-e $request _filename) {Rewrite ^.+? (/wp-.*) $ last;Rewrite ^.+? (/.*\.php) $ $ last;rewrit
1, WordPress permissions on the installation and use of the effect is very large: permissions errors will affect the installation of theme: can not install theme or modify theme or delete theme. Related settings:chmod 755 WordPressFind Wordpress-type d-exec chmod 755 {} \;Find Wordpress-type f-exec chmod 644 {} \;chown-r nginx:nginx WordPressmethod See: http://my
: This article describes how to solve the fixed link nginx access 404 problem in wordpress configuration. if you are interested in the PHP Tutorial, refer to it. WordPress supports the use of fixed links, but in the ngnix environment, 404 appears after accessing the page,
In fact, the official documents indicate that you need to write the configuration separatel
Set WordPress 301 redirection for Nginx on CentOS Server
In the Nginx environment, use 301 for permanent redirection. The code is:
Rewrite ^/archives/(. *)/$1 permanent;
You can also write data separately, for example:
Rewrite ^/archive/(%0-9%%%%%.html $/%1.html permanent; # rewrite ^/archive/category /(. *) $/category/$1 permanent; # directory category rewri
The server has been running around for a long time.The environment is also exchanged for severalApache and nginx;Always environment problemsTested, the following code is perfectly compatible with the pseudo-static rules of Nginx. The code is as follows:Copy code Rewrite ^. */files/(. *) $/wp-nodes des/ms-files.php? File = $1 last;If (! -E $ request_filename ){Rewrite ^. +? (/Wp-. *) $1 last;Rewrite ^. +
In Nginx environment access sometimes access WordPress backstage will directly return the error. Carefully find the path is less wp-admin, the solution is simple to modify in the/usr/local/nginx/conf/wordpress.conf fileLocation/ {index index.html index.php; if (-F $request _filename/index.html) {rewrite (. *) $1break; if (-F $request _filename/index.php) {rewrite
Nginx allows Wordpress to support pseudo-static rules with fixed links
To make nginx support for WordPress fixed links very simple, you need to add Point configuration by yourselfCode:
Copy codeThe Code is as follows: Location /{
If (-F $ request_filename/index.html ){
Rewrite (. *) $1/index.html break;
}
If (-F
Alas, it seems to be good to restart the machine often. By the way, what's the benefit of restarting the machine, the reboot will check the hardware ... You know..
This is because the background was rewritten to cause
WordPress official must have been solved, so we look at the official documents.
The code is as follows
Copy Code
Http://www.111cn.net/Nginx# Add trailing Slash
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. # Upstream to abstract backend connection (s) for phpupstream php {
WordPress supports the use of fixed links, but in the Ngnix environment, access to the page appears after 404,
In fact, the official document is documented, need to write a separate configuration,
The sample code I configured here is as follows:
server { listen ; server_name www.chaichunyan.com; Access_log /var/log/nginx/access.log main;location/{ root/www/data/xxx; Index
0 04:37? 00:00:00 nginx:worker processroot 10342 10069 0 06:26 pts/1 00:00:00 grep nginxThen you can test if the nginx is in effect.You can launch two Tomcat in the 192.168.1.104 and 192.168.1.102 servers.And thenhttp://192.168.1.106/test/index.jspVisit a bitI put a test project under the 102 104 machine Tomcat, and there's a index.jsp file in the project.If you can access it to show that the Ngin
To edit the Nginx configuration file:
sudo vi /etc/nginx/sites-available/default
Add the following code to the server{...}:
location ~* /xmlrpc.php { all; }
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the
The website access directory is http://show.abc.com/, but wordpress is packed in the manage directory below him, so the Accessed home page should also be a http://show.abc.com/manage/What is the default wordpress URL to access the article is http://show.abc.com/manage? P = 12 form, need to do pseudo static make article access form for http://show.abc.com/manage/12Configure
The blog that was written a few days ago has a bug that causes the background to be inaccessible and found 302 issues.http://ningyuqiao.blog.51cto.com/5581274/1615552For example: Website for Http://ningyuqiao.51cto.com/bloglocation/blog/{if (-F $request _filename/index.html) {rewrite (. *) $1/index.html break;}if (-f $request _filename/index.php) {rewrite (. *) $1/index.php;}if (!-f $request _filename) {rewrite (. *)/blog/index.php; }}Site level two directory or sub-directory install
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.