This article was written today (2016-01-21), because I have not played with Nginx deployment before, and thanks to our digitized general manager. Here is a record of your own growth experience, and the problems encountered.
Because their domain name is bought on the million online, parsing cannot parse directly into subdirectories, so the server configuration must be changed.
First say your own WordPress is how to deploy, their own IP directly mapped to the WWW directory, the WordPress directory is under the WWW, so their domain name to
First Use this is homily.cn binding to my own IP root (www directory), and then in this, the explicit URL
have been using this, the middle spent a few hours to get through this path problem, unsuccessful, and I reverted to this.
———————————————————————— – ————— – above is a painful experience ——————————————————-
Today, the configuration of the address is also a 1-hour toss, to get around or the configuration file is wrong. A problem occurred during the restart of the service:
After restarting Nginx lost Nginx.pid, how to restart Nginx follow this step to execute the next command just fine.
Under server/nginx/conf/, with the VI command to open nginx.conf, will find include/alidata/server/nginx/conf/vhosts/*.conf;
Then find this directory, open the directory below the. conf file and open it with VI (which changes the root to the absolute directory, server_name to the following form.) But in the WordPress page before the home page is http://12.12.12.12/wordpress, the page will not be able to access, you need to change the following root to the WWW directory, with phpMyAdmin to change the database of relevant data, There's a sticker in front of me.
Listen 80;
server_name www.homily.cn homily.cn;
Index index.html index.htm index.php;
root/alidata/www/wordpress;
Location ~. *\. (PHP|PHP5)? $
{
#fastcgi_pass Unix:/tmp/php-cgi.sock;
Fastcgi_pass 127.0.0.1:9001;
Fastcgi_index index.php;
Include fastcgi.conf;
}
Location ~. *\. (gif|jpg|jpeg|png|bmp|swf) $
{
Expires 30d;
}
Location ~. *\. (JS|CSS)? $
{
Expires 1h;
}
#Î ±¾²ì¬¹æôò
}
———-
In addition, you may encounter issues related to level two domain names and 301 permanent redirects later.
[OPS-server –2a]–nginx bind domain name