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.