When you first install the wordpress program, nginx configuration The port is 8081.
After starting the nginx and php services, visit http://www.example.com:8081/wp-admin to start the gradual installation, and then successfully build the blog website.
After the website has been running for a period of time, you need to change port 8081 to port 80. At this time, change port 8081 in the nginx configuration to port 80, and reload the nginx configuration file. Accessing the website will automatically jump to port 8081. (Old port configured last time), clearing the browser cache and restarting nginx still cannot solve the problem.
Cause of the problem:
When installing wordpress for the first time, it will Save the homepage address of the website to the WordPress database. When accessing the website in the future, the homepage address in the database shall prevail. If you individually change the access address mapped by web servers such as nginx (changes in IP, domain name, and port), it will still automatically jump to the database. Stored homepage address.
Solution:
Modify the wordpress database, wp_options table, option_name field is equal to 2 records of siteurl and home
Change The option_value value of these two records is updated to your latest changed address, for example: http://www.example.com or http://www.example.com:80
After the change is successful, you can Access the wordpress website normally through port 80
MySQL operation statement:
# wp_options表 查询记录 select * from wp_options where option_name in ('siteurl','home'); # wp_options表 更新option_value的值 update wp_options set option_value='http://www.example.com:80' where option_name in ('siteurl','home');