cd / etc / sysconfig / network-scripts
vi ifcfg-eth0
DEVICE = eth0
HWADDR = 00: 0C: 33: 6a: 90: F8
TYPE = Ethernet
UUID = de83281a-sa20-4791-b588-5621718adf4d
ONBOOT = yes
NM_CONTROLLED = yes
BOOTPROTO = static
IPADDR = 217.11.175.73
NETMASK = 255.255.255.224
GATEWAY = 217.11.175.33
DNS1 = 217.11.190.2
cd / etc / sysconfig / network-scripts
vi ifcfg-eth0
DEVICE = eth1
HWADDR = 00: 0V: 35: 6a: 90: F3
TYPE = Ethernet
UUID = de83281a-sa10-4791-b577-5621718adf4d
ONBOOT = yes
NM_CONTROLLED = yes
BOOTPROTO = static
IPADDR = 192.168.1.3
NETMASK = 255.255.255.0
yum update -y
# wget nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-rhel-6-0.el6.ngx.noarch.rpm
yum install nginx -y
/ etc / nginx
cp nginx.conf /etc/nginx/nginx.conf.backup
rm nginx.conf
vi nginx.conf
# user and group from which the process starts
user nginx;
# 3 workflows
worker_processes 3;
# Error log
error_log /var/log/nginx/error.log debug;
events {
# maximum working connections
worker_connections 1024;
}
http {
# We connect the mime table
include mime.types;
# default mime type
default_type application / octet-stream;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
sendfile on;
# The module allows you to describe groups of servers that can be used.
# in the proxy_pass and fastcgi_pass directives.
upstream web {
# This parameter hashes the session by the first 4 acts of IP addresses, which is very helpful if someone uses asynchronous requests
ip_hash;
# Directive specifies server name and parameters. Please note we will
# use the name "pv" in the directive proxy_pass
server 192.168.28.8 weight = 2; # max_fails = 60 fail_timeout = 2s;
server 192.168.28.9 weight = 2; # max_fails = 60 fail_timeout = 2s;
}
server {
# Play port 80
listen 80;
location / {
# The proxy_pass directive mentioned earlier
proxy_pass web;
# Connect proxy settings
include /etc/nginx/proxy.conf;
}
}
}
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 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_cache_bypass http;
Source: https://habr.com/ru/post/213739/
All Articles