Nginx Static website cannot display picture problem

Source: Internet
Author: User
Today I would like to put the exercise on the server to see, but live and die do not display pictures, now the solution to record:

First, record the following nginx commands:

Start Nginx                      //Run Nginxnginx-s stop//          stop nginxnginx-s Reload       //Reload the configuration file (such as after modifying the configuration file, can be reloaded by this command) Nginx-s quit< c3/>//exit Nginxnginx-v                 //Can be checked Nginx version

Then modify the nginx.conf file in the/usr/local/nginx/conf directory, plus this paragraph:
Location ~* ^.+\. (jpg|jpeg|gif|png|bmp) $ {        access_log off;        root html;        Expires 30d;        break;        }
We're going to write the site directory behind root.

Finally, the image folder and image authorization, to give all users to view permissions:

chmod 774./images

Finally, use the command above to reload the configuration:

Nginx-s Reload

OK, now it's time to show the picture. (In fact, I think the main problem is the authority, the middle of the code seems to be what background images can not be used when ... )

The above describes the Nginx static website can not display the picture problem, including the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.