Change the default directory for Nginx to/var/www

Source: Internet
Author: User
Tags 403 forbidden error nginx server

Just contact Nginx Server today, found that it is too powerful, but its default directory is not/var/www, used to the Apache server, so want to nginx the root directory to/var/www, try some, can do the following configuration:
1, into the/etc/aginx/conf/vhosts directory, edit the default.conf file under the root of the corresponding value, the site root directory to the directory you want to change.
2, save, use the Kill-hup main process number command smooth restart Nginx server, and then open the browser, you will find 403 Forbidden error, the solution is to add the root directory of the site you want to the WWW:WWW user group.

Nginx server Some of the most common commands:

Nginx-v View version number

Nginx-v view version numbers and related compilation information

Nginx-t detection configuration file is correct

Nginx-t-C Config file directory detects whether the specified profile is correct

Kill-hup main process number smooth reboot Nginx server

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.