Problems with nginx domain name redirection

Source: Internet
Author: User
: This article mainly introduces the problem of nginx domain name redirection. if you are interested in the PHP Tutorial, please refer to it. At the customer's request, we need to assign a domain name to the customer. then, we recommend that you do not have a domain name server in the background. this is not safe. domain names are generally configured on external web servers;

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

Server {
Listen 80; ---------- fixed port 80
Server_name a B; ------ separated by commas (,) between the first-level domain name and second-level domain name
Location /{
Root/alidata1/tomcat-tes /......; -------- Server absolute path root directory
Index index.html index.htm index. jsp;
Proxy_send_timeouts 1200;
Proxy_connect_timeout 1200;
Proxy_pass http: // 121. 41. *. 216 *; ---------- address to be compared
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 {-------- second-level path of the server business module
Index index.html index.htm index. jsp;
Proxy_send_timeouts 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_timeouts 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 modification, restart the nginx command, service nginx restart

Restart tomcat if necessary,

Nginx

The above describes the problems encountered by nginx domain name redirection, including some content, and hope to be helpful to friends who are interested in PHP tutorials.

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.