[OPS-server –2a]–nginx bind domain name

Source: Internet
Author: User

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

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.