{"id":356723,"date":"2024-05-20T23:35:38","date_gmt":"2024-05-20T23:35:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=356723"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=356723","title":{"rendered":"<span>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Nginx multiple reverse proxy \u0434\u043b\u044f k3s+istio<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u043e\u0434\u044b<\/h2>\n<p>\u0412\u0441\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c, \u043f\u0440\u0438\u0432\u0435\u0442! \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e Nginx reverse proxy \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430. \u041d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e \u043d\u043e \u043a\u0440\u0438\u0442\u0438\u043a\u0435 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u0443\u0434\u0443 \u0440\u0430\u0434.<\/p>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e<\/h2>\n<p>\u041f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0432\u044b\u0437\u043e\u0432 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u0435\u0439\u0441\u0430:<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u0442\u044c 1 ip \u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043e n \u0434\u043e\u043c\u0435\u043d\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c n \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 (\u0437\u0430 NAT)<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d_1 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440_1<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d_2 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440_2<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d_n \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440_n<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430&#8230; \u041d\u043e \u043d\u0435 \u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0435\u0441\u0442\u044c<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435<\/h2>\n<p>\u0418\u0437 \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0432\u0435\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0445\u0435\u043c\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441.1. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/0b2\/c5c\/341\/0b2c5c341f5b00680413b9a16d6cd4ad.jpg\" alt=\"\u0440\u0438\u0441.1\" title=\"\u0440\u0438\u0441.1\" width=\"954\" height=\"381\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b2\/c5c\/341\/0b2c5c341f5b00680413b9a16d6cd4ad.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0440\u0438\u0441.1<\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0435\u0439\u0441\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c Nginx \u0432 \u044d\u0442\u0443 \u0441\u0445\u0435\u043c\u0443. \u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441.2<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/e45\/3c2\/cee\/e453c2cee285cf104dc1dffdae090903.jpg\" width=\"1095\" height=\"941\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e45\/3c2\/cee\/e453c2cee285cf104dc1dffdae090903.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 istio \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Nginx reverse proxy<\/h2>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u043d\u044b\u0445:<\/p>\n<ol>\n<li>\n<p>\u041e\u0421 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Centos7<\/p>\n<\/li>\n<li>\n<p>Iptables \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u0435\u0442 \u0438\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u043a\u0440\u043e\u043c\u0435 443<\/p>\n<\/li>\n<li>\n<p>Istio \u043d\u0430\u0446\u0435\u043b\u0435\u043d \u043d\u0430 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0412\u041c<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u041e\u0421 Centos7 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 http \u0438 server \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u044b. \u041d\u043e \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043a\u0430\u043a \u0432 Ubuntu \u044d\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \ud83d\ude09<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f nginx \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>worker_processes 10;     events {     worker_connections 1024; } http {     include mime.types;     default_type application\/octet-stream;     sendfile on;     keepalive_timeout 65;     #\u0412\u041c_1     server {         server_name test1.domain.ru;         listen       443 ssl;         listen [::]:443 ssl;         ssl_certificate      \/home\/CERT.crt;         ssl_certificate_key  \/home\/CERT.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_protocols        TLSV1.1 TLSV1.2 TLSV1.3;         ssl_ciphers  HIGH:!aNULL:!MD5;         ssl_prefer_server_ciphers  on;         location \/ {             proxy_pass https:\/\/192.168.0.21;             proxy_http_version  1.1;             proxy_cache_bypass  $http_upgrade;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-Host  $host;             proxy_set_header X-Forwarded-Proto $scheme;             proxy_set_header X-Forwarded-Port  $server_port;         }     #\u0412\u041c_2     server {         server_name test2.domain.ru;         listen       443 ssl;         listen [::]:443 ssl;         ssl_certificate      \/home\/CERT.crt;         ssl_certificate_key  \/home\/CERT.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_protocols        TLSV1.1 TLSV1.2 TLSV1.3;         ssl_ciphers  HIGH:!aNULL:!MD5;         ssl_prefer_server_ciphers  on;         location \/ {             proxy_pass https:\/\/192.168.0.21;             proxy_http_version  1.1;             proxy_cache_bypass  $http_upgrade;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-Host  $host;             proxy_set_header X-Forwarded-Proto $scheme;             proxy_set_header X-Forwarded-Port  $server_port;         }     }     #\u0412\u041c_n     server {         server_name testn.domain.ru;         listen       443 ssl;         listen [::]:443 ssl;         ssl_certificate      \/home\/CERT.crt;         ssl_certificate_key  \/home\/CERT.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_protocols        TLSV1.1 TLSV1.2 TLSV1.3;         ssl_ciphers  HIGH:!aNULL:!MD5;         ssl_prefer_server_ciphers  on;         location \/ {             proxy_pass https:\/\/192.168.0.x;             proxy_http_version  1.1;             proxy_cache_bypass  $http_upgrade;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-Host  $host;             proxy_set_header X-Forwarded-Proto $scheme;             proxy_set_header X-Forwarded-Port  $server_port;         }     } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<h3>\u041e\u0431\u0449\u0438\u0439 \u0431\u043b\u043e\u043a:<\/h3>\n<ul>\n<li>\n<p><strong>worker_processes<\/strong>\u00a0&#8212; \u041a\u043e\u043b\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 IP. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430 \u044f\u0434\u0440\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f 1 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441;<\/p>\n<\/li>\n<li>\n<p><strong>worker_processes<\/strong>\u00a0&#8212; \u041a\u043e\u043b\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u043e\u0433\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f Nginx;<\/p>\n<\/li>\n<\/ul>\n<h3>\u0411\u043b\u043e\u043a http {<\/h3>\n<ul>\n<li>\n<p><strong>keepalive_timeout<\/strong>\u00a0&#8212; \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f keepalive-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e \u043d\u0435\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0411\u043b\u043e\u043a http { server {<\/h3>\n<ul>\n<li>\n<p><strong>server_name<\/strong>\u00a0&#8212; \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/testn.domain.ru\" rel=\"noopener noreferrer nofollow\">testn.domain.ru<\/a><\/p>\n<\/li>\n<li>\n<p><strong>listen<\/strong>\u00a0&#8212; \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u0442 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 https\/443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0438\u00a0<strong>ssl<\/strong>\u00a0\u0432 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>ssl_certificate\/ssl_certificate_key<\/strong>\u00a0&#8212; \u0434\u043e\u043c\u0435\u043d\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b<\/p>\n<\/li>\n<li>\n<p><strong>ssl_session_cache<\/strong>\u00a0&#8212; \u041a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0439. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0445\u044d\u043d\u0434\u0448\u0435\u0439\u043a.<\/p>\n<\/li>\n<li>\n<p><strong>ssl_protocols<\/strong>\u00a0&#8212; \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 TLS \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0411\u043b\u043e\u043a http { server { location \/ {<\/h3>\n<blockquote>\n<p><strong>\u0412\u0410\u0416\u041d\u041e<\/strong><br \/>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0440\u043e\u043d\u0442 \u0441 url <strong>testn.domain.ru\/front<\/strong> \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 location \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 (\/). \u0421\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 url \u043e\u0442 nginx \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043e \u0432\u0440\u0435\u043c\u044f proxy. istio \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0431\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 <strong>rewrite \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442<\/strong><\/p>\n<\/blockquote>\n<ul>\n<li>\n<p><strong>proxy_pass<\/strong>\u00a0&#8212; \u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u0430, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 server_name \u0431\u043b\u043e\u043a\u0430 server.\u00a0<\/p>\n<\/li>\n<li>\n<p><strong>proxy_http_version<\/strong>\u00a0&#8212; \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HTTP\/1.1 \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 HTTP\/1.0<\/p>\n<\/li>\n<li>\n<p><strong>proxy_cache_bypass<\/strong>\u00a0&#8212; \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043e\u0442\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 http \u0437\u0430\u043f\u0440\u043e\u0441\u0430 ($http_upgrade)<\/p>\n<\/li>\n<li>\n<p><strong>proxy_set_header<\/strong>\u00a0&#8212; \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f proxy_pass<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/nginx.org\/en\/docs\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0430\u0445 nginx<\/a>.<\/p>\n<p>\u0414\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0447\u0442\u043e \u043f\u043e \u043d\u0435\u0437\u043d\u0430\u043d\u0438\u044e \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443 \u044f \u0448\u0435\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e. 3 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0434\u043d\u044f \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u044b\u043c.<br \/>\u042f \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u043c\u043e\u0433 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0440\u0443\u0436\u0438\u0442\u044c istio \u0438 nginx \u0438 \u043f\u0435\u0440\u0435\u043b\u043e\u043f\u0430\u0442\u0438\u043b \u043a\u0443\u0447\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0418 \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435? \u0421\u0430\u043c\u044b\u0439 \u0432\u0430\u0436\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430 &#8212; \u044d\u0442\u043e <strong>proxy_cache_bypass. <\/strong><\/p>\n<p>\u0412 \u0447\u0435\u043c \u0436\u0435 \u0441\u0443\u0442\u044c \u044d\u0442\u043e\u0433\u043e <strong>proxy_cache_bypass? <br \/><em>proxy_cache_bypass<\/em><\/strong>\u00a0\u2014 \u0417\u0430\u0434\u0430\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 nginx \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u0440\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0438\u0437 \u043a\u044d\u0448\u0430, \u0430 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0438 \u043d\u0435 \u0440\u0430\u0432\u0435\u043d \u201c0\u201d. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432\u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/articles\/428127\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a><\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0433\u043a\u043e \u0430\u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439\/\u0443\u0434\u0430\u043b\u044f\u0435\u043c\u044b\u0439\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u0431\u043b\u043e\u043a &#8212; \u044d\u0442\u043e \u0431\u043b\u043e\u043a <em>http { server {<\/em><\/p>\n<pre><code>    #\u0412\u041c_n     server {         server_name testn.domain.ru;         listen       443 ssl;         listen [::]:443 ssl;         ssl_certificate      \/home\/CERT.crt;         ssl_certificate_key  \/home\/CERT.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_protocols        TLSV1.1 TLSV1.2 TLSV1.3;         ssl_ciphers  HIGH:!aNULL:!MD5;         ssl_prefer_server_ciphers  on;         location \/ {             proxy_pass https:\/\/192.168.0.x;             proxy_http_version  1.1;             proxy_cache_bypass  $http_upgrade;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-Host  $host;             proxy_set_header X-Forwarded-Proto $scheme;             proxy_set_header X-Forwarded-Port  $server_port;         }     }<\/code><\/pre>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0430\u044f \u0432\u0441\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u043a\u0435\u0439\u0441\u0430. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/765536\/\"> https:\/\/habr.com\/ru\/articles\/765536\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u043e\u0434\u044b<\/h2>\n<p>\u0412\u0441\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c, \u043f\u0440\u0438\u0432\u0435\u0442! \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e Nginx reverse proxy \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430. \u041d\u0435 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e \u043d\u043e \u043a\u0440\u0438\u0442\u0438\u043a\u0435 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u0443\u0434\u0443 \u0440\u0430\u0434.<\/p>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e<\/h2>\n<p>\u041f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0432\u044b\u0437\u043e\u0432 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u0435\u0439\u0441\u0430:<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u0442\u044c 1 ip \u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043e n \u0434\u043e\u043c\u0435\u043d\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c n \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 (\u0437\u0430 NAT)<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d_1 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440_1<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d_2 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440_2<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d_n \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440_n<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430&#8230; \u041d\u043e \u043d\u0435 \u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0435\u0441\u0442\u044c<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435<\/h2>\n<p>\u0418\u0437 \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0432\u0435\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0445\u0435\u043c\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441.1. <\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0440\u0438\u0441.1<\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0435\u0439\u0441\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c Nginx \u0432 \u044d\u0442\u0443 \u0441\u0445\u0435\u043c\u0443. \u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441.2<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 istio \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Nginx reverse proxy<\/h2>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u043d\u044b\u0445:<\/p>\n<ol>\n<li>\n<p>\u041e\u0421 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Centos7<\/p>\n<\/li>\n<li>\n<p>Iptables \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u0435\u0442 \u0438\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432 \u043a\u0440\u043e\u043c\u0435 443<\/p>\n<\/li>\n<li>\n<p>Istio \u043d\u0430\u0446\u0435\u043b\u0435\u043d \u043d\u0430 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0412\u041c<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u041e\u0421 Centos7 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 http \u0438 server \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u044b. \u041d\u043e \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043a\u0430\u043a \u0432 Ubuntu \u044d\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \ud83d\ude09<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f nginx \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>worker_processes 10;     events {     worker_connections 1024; } http {     include mime.types;     default_type application\/octet-stream;     sendfile on;     keepalive_timeout 65;     #\u0412\u041c_1     server {         server_name test1.domain.ru;         listen       443 ssl;         listen [::]:443 ssl;         ssl_certificate      \/home\/CERT.crt;         ssl_certificate_key  \/home\/CERT.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_protocols        TLSV1.1 TLSV1.2 TLSV1.3;         ssl_ciphers  HIGH:!aNULL:!MD5;         ssl_prefer_server_ciphers  on;         location \/ {             proxy_pass https:\/\/192.168.0.21;             proxy_http_version  1.1;             proxy_cache_bypass  $http_upgrade;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-Host  $host;             proxy_set_header X-Forwarded-Proto $scheme;             proxy_set_header X-Forwarded-Port  $server_port;         }     #\u0412\u041c_2     server {         server_name test2.domain.ru;         listen       443 ssl;         listen [::]:443 ssl;         ssl_certificate      \/home\/CERT.crt;         ssl_certificate_key  \/home\/CERT.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_protocols        TLSV1.1 TLSV1.2 TLSV1.3;         ssl_ciphers  HIGH:!aNULL:!MD5;         ssl_prefer_server_ciphers  on;         location \/ {             proxy_pass https:\/\/192.168.0.21;             proxy_http_version  1.1;             proxy_cache_bypass  $http_upgrade;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-Host  $host;             proxy_set_header X-Forwarded-Proto $scheme;             proxy_set_header X-Forwarded-Port  $server_port;         }     }     #\u0412\u041c_n     server {         server_name testn.domain.ru;         listen       443 ssl;         listen [::]:443 ssl;         ssl_certificate      \/home\/CERT.crt;         ssl_certificate_key  \/home\/CERT.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_protocols        TLSV1.1 TLSV1.2 TLSV1.3;         ssl_ciphers  HIGH:!aNULL:!MD5;         ssl_prefer_server_ciphers  on;         location \/ {             proxy_pass https:\/\/192.168.0.x;             proxy_http_version  1.1;             proxy_cache_bypass  $http_upgrade;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-Host  $host;             proxy_set_header X-Forwarded-Proto $scheme;             proxy_set_header X-Forwarded-Port  $server_port;         }     } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<h3>\u041e\u0431\u0449\u0438\u0439 \u0431\u043b\u043e\u043a:<\/h3>\n<ul>\n<li>\n<p><strong>worker_processes<\/strong>\u00a0&#8212; \u041a\u043e\u043b\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 IP. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430 \u044f\u0434\u0440\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f 1 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441;<\/p>\n<\/li>\n<li>\n<p><strong>worker_processes<\/strong>\u00a0&#8212; \u041a\u043e\u043b\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u043e\u0433\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f Nginx;<\/p>\n<\/li>\n<\/ul>\n<h3>\u0411\u043b\u043e\u043a http {<\/h3>\n<ul>\n<li>\n<p><strong>keepalive_timeout<\/strong>\u00a0&#8212; \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f keepalive-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e \u043d\u0435\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0411\u043b\u043e\u043a http { server {<\/h3>\n<ul>\n<li>\n<p><strong>server_name<\/strong>\u00a0&#8212; \u041e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/testn.domain.ru\" rel=\"noopener noreferrer nofollow\">testn.domain.ru<\/a><\/p>\n<\/li>\n<li>\n<p><strong>listen<\/strong>\u00a0&#8212; \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u0442 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 https\/443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0438\u00a0<strong>ssl<\/strong>\u00a0\u0432 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>ssl_certificate\/ssl_certificate_key<\/strong>\u00a0&#8212; \u0434\u043e\u043c\u0435\u043d\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b<\/p>\n<\/li>\n<li>\n<p><strong>ssl_session_cache<\/strong>\u00a0&#8212; \u041a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0439. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0445\u044d\u043d\u0434\u0448\u0435\u0439\u043a.<\/p>\n<\/li>\n<li>\n<p><strong>ssl_protocols<\/strong>\u00a0&#8212; \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 TLS \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0411\u043b\u043e\u043a http { server { location \/ {<\/h3>\n<blockquote>\n<p><strong>\u0412\u0410\u0416\u041d\u041e<\/strong><br \/>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0440\u043e\u043d\u0442 \u0441 url <strong>testn.domain.ru\/front<\/strong> \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 location \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 (\/). \u0421\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 url \u043e\u0442 nginx \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043e \u0432\u0440\u0435\u043c\u044f proxy. istio \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0431\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 <strong>rewrite \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442<\/strong><\/p>\n<\/blockquote>\n<ul>\n<li>\n<p><strong>proxy_pass<\/strong>\u00a0&#8212; \u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u0430, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 server_name \u0431\u043b\u043e\u043a\u0430 server.\u00a0<\/p>\n<\/li>\n<li>\n<p><strong>proxy_http_version<\/strong>\u00a0&#8212; \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HTTP\/1.1 \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 HTTP\/1.0<\/p>\n<\/li>\n<li>\n<p><strong>proxy_cache_bypass<\/strong>\u00a0&#8212; \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043e\u0442\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 http \u0437\u0430\u043f\u0440\u043e\u0441\u0430 ($http_upgrade)<\/p>\n<\/li>\n<li>\n<p><strong>proxy_set_header<\/strong>\u00a0&#8212; \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f proxy_pass<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/nginx.org\/en\/docs\/\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0430\u0445 nginx<\/a>.<\/p>\n<p>\u0414\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0447\u0442\u043e \u043f\u043e \u043d\u0435\u0437\u043d\u0430\u043d\u0438\u044e \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443 \u044f \u0448\u0435\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e. 3 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0434\u043d\u044f \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u044b\u043c.<br \/>\u042f \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u043c\u043e\u0433 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0440\u0443\u0436\u0438\u0442\u044c istio \u0438 nginx \u0438 \u043f\u0435\u0440\u0435\u043b\u043e\u043f\u0430\u0442\u0438\u043b \u043a\u0443\u0447\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0418 \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435? \u0421\u0430\u043c\u044b\u0439 \u0432\u0430\u0436\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430 &#8212; \u044d\u0442\u043e <strong>proxy_cache_bypass. <\/strong><\/p>\n<p>\u0412 \u0447\u0435\u043c \u0436\u0435 \u0441\u0443\u0442\u044c \u044d\u0442\u043e\u0433\u043e <strong>proxy_cache_bypass? <br \/><em>proxy_cache_bypass<\/em><\/strong>\u00a0\u2014 \u0417\u0430\u0434\u0430\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 nginx \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u0440\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0438\u0437 \u043a\u044d\u0448\u0430, \u0430 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0438 \u043d\u0435 \u0440\u0430\u0432\u0435\u043d \u201c0\u201d. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432\u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/articles\/428127\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a><\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043b\u0435\u0433\u043a\u043e \u0430\u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439\/\u0443\u0434\u0430\u043b\u044f\u0435\u043c\u044b\u0439\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u0431\u043b\u043e\u043a &#8212; \u044d\u0442\u043e \u0431\u043b\u043e\u043a <em>http { server {<\/em><\/p>\n<pre><code>    #\u0412\u041c_n     server {         server_name testn.domain.ru;         listen       443 ssl;         listen [::]:443 ssl;         ssl_certificate      \/home\/CERT.crt;         ssl_certificate_key  \/home\/CERT.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_protocols        TLSV1.1 TLSV1.2 TLSV1.3;         ssl_ciphers  HIGH:!aNULL:!MD5;         ssl_prefer_server_ciphers  on;         location \/ {             proxy_pass https:\/\/192.168.0.x;             proxy_http_version  1.1;             proxy_cache_bypass  $http_upgrade;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header X-Forwarded-Host  $host;             proxy_set_header X-Forwarded-Proto $scheme;             proxy_set_header X-Forwarded-Port  $server_port;         }     }<\/code><\/pre>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0430\u044f \u0432\u0441\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u043a\u0435\u0439\u0441\u0430. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/765536\/\"> https:\/\/habr.com\/ru\/articles\/765536\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-356723","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/356723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=356723"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/356723\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=356723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=356723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=356723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}