In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "nginx server configuration case analysis under ubuntu". In daily operation, I believe that many people have doubts about nginx server configuration case analysis under ubuntu. Xiaobian consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the doubts of "nginx server configuration case analysis under ubuntu". Next, please follow the editor to study!
Detailed explanation of nginx server configuration under ubuntu
Installation of 1.nginx server
Sudo apt-get install nginx
Startup of 2.nginx server
Sudo / etc/init.d/nginx start
3. Multiple domain names correspond to different background servers
Delete the default configuration file in the / etc/nginx/sites-enabled/ directory
The configuration file for the new domain name
Like test.youlunshidai.com.
# through upstream nodejs__upstream, you can configure multiple nodejs nodes to do load balancer upstream nodejs__upstream__test__youlunshidai {server 127.0.0.1 upstream nodejs__upstream__test__youlunshidai 8089; # server address and port number # server 127.0.1 upstream nodejs__upstream__test__youlunshidai 8088; # load balancer server address and port number keepalive 64; # set the time to live. If not set, a large number of timewait} server {listen 80; server_name test.youlunshidai.com; access_log / var/log/nginx/test_youlunshidai.log; # nginx log files location / {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; proxy_set_header x-nginx-proxy true; proxy_set_header connection "; proxy_http_version 1.1 may be generated. Proxy_pass http://nodejs__upstream__test__youlunshidai; # reverse proxy forwarding http://nodejs__upstream;}}
If there are other domain names and background servers, you can continue to create the corresponding domain name profile in the directory.
At this point, the study of "nginx server configuration instance analysis under ubuntu" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.