Configure Nginx under Linux to use the FTP directory as the target directory for static resource files

Source: Internet
Author: User

1, install the FTP service, you can directly yum install VSFTPD.

2, set the random start, Chkconfig vsftpd on.

3, start the FTP service vsftpd start.

4, configure Nginx static resource redirection.

Let's say we store a static resource file in our custom directory/usr/local/app/yidoo/ebs-k3c/file/, and we want the request to be forwarded to/usr/local/app/yidoo/when we access www.domain.com/file/*. ebs-k3c/file/, this time Nginx can be configured as follows:

        location/file/{            root   /;    Rewrite ^/file/(. *) $/usr/local/app/yidoo/ebs-k3c/file/$1 break;        }

Accessing Www.domain.com/file/abc.txt at this point accesses the/usr/local/app/yidoo/ebs-k3c/file/abc.txt and returns it to the client, which is 404 if it does not exist.

See also FTP Server Setup under CentOS (and how to troubleshoot startup failures)

See Nginx location for details, original essence notes

Configure Nginx under Linux to use the FTP directory as the target directory for static resource files

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.