Get the App
SLTechnology News&Howtos  ›  Servers  › 

001Nginx cluster deployment

Shulou Source: shulou.com Published: 2022-06-03 05:36:31 10月04日 Update

Http://nginx.org/en/download.html NGINX download address

Https://blog.csdn.net/qq_35393693/article/details/80405911 NGINX other people's blog

Https://www.cnblogs.com/liang-wei/p/5849771.html NGINX configuration details

NGINX.conf file configuration

# user nobody

Worker_processes 1

# error_log logs/error.log

# error_log logs/error.log notice

# error_log logs/error.log info

# pid logs/nginx.pid

Events {

Worker_connections 1024

}

Http {

Include mime.types

Default_type application/octet-stream

# log_format main'$remote_addr-$remote_user [$time_local] "$request" #'$status $body_bytes_sent "$http_referer" #'"$http_user_agent"$http_x_forwarded_for"'; # access_log logs/access.log main;sendfile on;#tcp_nopush on;#keepalive_timeout 0keepalivekeepalivetimeout 65 itsegzip on # set load balancing policy upstream skcc.chart {# ip_hash; # session tape, incomplete load balancing This node represents the Nginx-enabled ip hash allocation algorithm, which means that different requests for the same ip address will be assigned to the same server. # the advantage is that there is no need to use third-party tools to manage Session, but the disadvantage is that it is not true load balancer (some server requests cannot be processed, and some servers only receive a small number of requests). # Please delete this configuration node if you use a third-party Session management tool. # polling server configuration. The higher the weight weight, the greater the probability of being assigned. Server 127.0.0.1 weight=1; server 127.0.0.1 weight=1; server 8080 weight=1;} server {listen 2019; server_name chart; location / {root html; index index.html index.htm; proxy_pass http://skcc.chart; proxy_connect_timeout 1 Proxy_send_timeout 1; proxy_read_timeout 1;} server {listen 2018; server_name egssdev; # charset koi8-r; # access_log logs/host.access.log main; location / {root html; index index.html index.htm; proxy_pass http://172.26.205.117:8080; } # error_page 404 / 404.html; # redirect server error pages to the static page / 50x.html # error_page 500502 503504 / 50x.html; location = / 50x.html {root html;} # proxy the PHP scripts to Apache listening on 127.0.1 php$ 80 # location ~\. Php$ {# proxy_pass #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1 pass the PHP scripts to FastCGI server listening on 9000 # # location ~\. Php$ {# root html; # fastcgi_pass 127.0.0.1 php$ 9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME / scripts$fastcgi_script_name; # include fastcgi_params #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # # location ~ /\ .ht {# deny all; #}} # another virtual host using mix of IP-, name-, and port-based configuration# another virtual host using mix of IP-, name-, and port-based configuration##server {# listen 8000 leading # listen somename:8080;# server_name somename alias another.alias # location / {# root html;# index index.html index.htm;#} #} # HTTPS server##server {# listen 443 ssl;# server_name localhost;# ssl_certificate cert.pem;# ssl_certificate_key cert.key;# ssl_session_cache shared:SSL:1m;# ssl_session_timeout 5m # ssl_prefer_server_ciphers on;# location / {# root html;# index index.html index.htm;#} #}

}

Tags: Servers services configuration equalization allocation addresses that is tools third parties nodes management differences disuse odds blogs disadvantages advantages meaning files policies Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple NVidia Docker Linux Shulou Information