Коллеги!
Есть следующая связка:
- cisco
ip nat include external_ip internal_haproxy_ip 443
- haproxy
frontend https-in mode http bind *:443 ssl crt /etc/haproxy/ssl/ acl is_site_name hdr_end(host) -i site_name.com use_backend site_name if is_site_name use_backend mail if is_mail backend site_name mode http server internal_site_name.com 192.168.0.2:443 ssl verify none
- nginx
server { listen 443 default_server ssl; server_name _; # Enable SSL connection include bx/conf/ssl.conf; server_name_in_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host:443; proxy_set_header HTTPS YES; set $proxyserver "http://127.0.0.1:8888"; set $docroot "/home/bitrix/www"; index index.php; root /home/bitrix/www; # Include parameters common to all websites include bx/conf/bitrix.conf; # Include server monitoring API's include bx/server_monitor.conf; }
- apache
<VirtualHost 127.0.0.1:8888> ServerAdmin webmaster@localhost DocumentRoot /home/bitrix/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <DirectoryMatch .*\.svn/.*> Deny From All </DirectoryMatch> <DirectoryMatch .*\.git/.*> Deny From All </DirectoryMatch> <DirectoryMatch .*\.hg/.*> Deny From All </DirectoryMatch> <Directory /home/bitrix/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All DirectoryIndex index.php index.html index.htm Order allow,deny allow from all php_admin_value session.save_path /tmp/php_sessions/www php_admin_value upload_tmp_dir /tmp/php_upload/www </Directory> <Directory /home/bitrix/www/bitrix/cache> AllowOverride none Order allow,deny Deny from all </Directory> <Directory /home/bitrix/www/bitrix/managed_cache> AllowOverride none Order allow,deny Deny from all </Directory> <Directory /home/bitrix/www/bitrix/local_cache> AllowOverride none Order allow,deny Deny from all </Directory> <Directory /home/bitrix/www/bitrix/stack_cache> AllowOverride none Order allow,deny Deny from all </Directory> <Directory /home/bitrix/www/upload> AllowOverride none AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht php_value engine off </Directory> <Directory /home/bitrix/www/upload/support/not_image> AllowOverride none Order allow,deny Deny from all </Directory> <Directory /home/bitrix/www/bitrix/images> AllowOverride none AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht php_value engine off </Directory> <Directory /home/bitrix/www/bitrix/tmp> AllowOverride none AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht php_value engine off </Directory> ErrorLog logs/error_log # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel warn CustomLog logs/access_log combined <IfModule mod_rewrite.c> #Nginx should have "proxy_set_header HTTPS YES;" in location RewriteEngine On RewriteCond %{HTTP:HTTPS} =YES RewriteRule .* - [E=HTTPS:on,L] </IfModule> </VirtualHost>
Можете разложить по модели OSI каждый уровень на каждом узле. При прохождении туда и обратно.
Что происходит на уровне http, ip, структуры пакета tcp/ip, заголовки, запросы и т.д.
Например. Возможно я не до конца прав. Поправте, дополните. Когда пользователь набирает в строке https://site_name.com, от формирует get запрос. get запрос находиться на прикладом уровне OSI. На уровень ниже находиться tcp. Когда пакет приходит на cisco, сisco не знает про http. Она передает пакет, меняя source ip на internal_haproxy_ip согласно nat правилу. И т.д.