Common configuration of Nginx in Linux (domain name jump HTTPS CDN configuration)

Source: Internet
Author: User

www Jump to primary domain

The code is as follows Copy Code

server {
Listen 80;
server_name www.111cn.net;

Access_log off;
Error_log off;

return to Http://tool.lu$request_uri;
}

HTTP jumps to HTTPS

The code is as follows Copy Code

server {
Listen 80;
server_name tool.lu;
return to Https://tool.lu$request_uri;
}

FastCGI

The code is as follows Copy Code
Location ~. php$ {
Try_files $uri = 404;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}

Cdn

  code is as follows copy code

Server {
    Listen 80;
    server_name s1.tool.lu s2.tool.lu s3.tool.lu s4.tool.lu;

    root/data/html/tool.lu/static;
    index index.html;

    Access_log off;
    error_log off;

    location/{
        concat on;
         concat_types text/css Application/javascript;
        # Troubleshoot Third-party libraries with JS statements not ending with semicolons
        Concat_delimiter "NN";
        concat_max_files

        expires 7d;
   }
}

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.