Nginx+Tomcat dynamic and static separation to achieve load balancing

0. Preliminary preparation Use the Debian environment. Install Nginx (installed by default), a web project, install tomcat (installed by default), etc. 1. A Nginx.conf configuration file # Define the user and user group that Nginx runs on. If the corresponding server is exposed to the outside, it is recommended to use a user with less authority to prevent intrusion # user www www; #Nginx process number, it is recommended to set it equal to the total number of CPU cores worker_processes 8; #Enable the global error log type error_log /var/log/nginx/error.log info; #Process file pid /var/run/nginx.pid; #The maximum number of file descriptions opened by an Nginx process is recommended to be consistent with ulimit -n #If you face high concurrency, pay attention to modify the value ulimit -n and some system parameters, not this one determined separately worker_rlimit_nofile 65535; events { #Use the epoll model to improve performance use epoll; #The maximum number of connections for a single process worker_connections 65535; } http{ #Extension and file type mapping table include mime.types; #default type default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; #log access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; #gzip compressed transfer gzip on; gzip_min_length 1k; #minimum 1K gzip_buffers 16…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索