Test Deployment Nginx

Source: Internet
Author: User

1, has installed the Nginx

2. Modify the Tomcat port number to 10081 (optional)

3 Modify Nginx's nginx.config as follows:

Upstream Apiserver {
Ip_hash;
Server 121.41.76.50:10081;
}
Upstream Consoleserver {
Ip_hash;
Server 121.41.76.50:10081;
}

server {
Listen 80;
server_name:121.41.76.50;
#charset Koi8-r;
#access_log Logs/host.access.log Main;
Location/console {
Proxy_pass Http://consoleserver;
#proxy setting
Proxy_redirect off;
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
#size limits
Client_max_body_size 50m;
Client_body_buffer_size 256k;

}
Location/down {#/followed by down cannot have spaces
Proxy_pass Http://consoleserver;
#proxy setting
Proxy_redirect off;
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
#size limits
Client_max_body_size 50m;
Client_body_buffer_size 256k;

}
Location/api {
Proxy_pass Http://apiserver;
Proxy_redirect off;
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Client_max_body_size 50m;
Client_body_buffer_size 256k;

}
}

/usr/local/nginx/sbin/nginx-t detection configuration file is configured successfully

/usr/local/nginx/sbin/nginx-s Reload Hot Restart

Test Deployment Nginx

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.