Remember to add a soft link to the Nginx Web server directory

Source: Internet
Author: User
Tags 403 forbidden error nginx server
Pre-conditions and issues

The Nginx server and related configuration are installed. The Nginx web directory is/usr/share/nginx/html.

The problem now is that you want to replace the web directory with/root/nginx/html/, but do not change the nginx.conf site root path configuration.

Solution Solutions

Use a soft link approach. (Soft links in Linux are equivalent to shortcuts in Windows)

Implementation steps
  1. mv/root/nginx/html//usr/share/nginx/Move the file to a new path
  2. Ln-s/root/nginx/html//root/nginx/html Creating a soft link
  3. Modify nginx.conf file Settings user root, restart Nginx
  4. Through Web Access, verify normal access, and if not, a 403 Forbidden error occurs. Please modify all file permissions under/root/nginx/html to 777.

Remember to add a soft link to the Nginx Web server directory

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.