Problems with Nginx domain redirection

Source: Internet
Author: User
Customer requirements, need to give customers a domain name, and then our big Niuqiang recommend not equipped with a domain name server, so unsafe, is generally external Web server to configure the domain name;

Install Nginx with another favorite blog post, and then modify the configuration file as follows:

server {
Listen 80; —————————— Fixed Port 80
server_name A B; —————— comma interval first-level domain name, level two domain name
Location/{
Root/alidata1/tomcat-tes/...; ———————— server absolute Path root directory
Index index.html index.htm index.jsp;
Proxy_send_timeout 1200;
Proxy_connect_timeout 1200;
Proxy_pass http://121.41.*.216*; —————————— to the right address.
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_set_header Host $http _host;
}
Location/share {———————— Server business module two-level path
Index index.html index.htm index.jsp;
Proxy_send_timeout 1200;
Proxy_connect_timeout 1200;
Proxy_pass http://121.4*;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_set_header Host $http _host;
}

Location/chao {
Index index.html index.htm index.jsp;
Proxy_send_timeout 1200;
Proxy_connect_timeout 1200;
Proxy_pass http://121.41.4*/;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_set_header Host $http _host;
}
}

After the modification to restart the Nginx command, service nginx restart

If necessary, reboot Tomcat,

Initial knowledge of Nginx

The above describes the Nginx domain redirection encountered problems, including the aspects of 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.