User Tools

Site Tools


сервис_http

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
сервис_http [2024/02/13 16:04]
val [Управление доступом к HTTP серверу с использованием OpenID аутентификации]
сервис_http [2024/05/05 18:37] (current)
val [HTTPS Прокси (пример 4)]
Line 87: Line 87:
 ==== CentOS ==== ==== CentOS ====
  
-  * Сервис Firewall [[Сервис Firewall#​CentOS ​7]]+  * Сервис Firewall [[Сервис Firewall#​CentOS]]
  
 <​code>​ <​code>​
Line 842: Line 842:
                 ## Keycloak                 ## Keycloak
                 OIDCSSLValidateServer Off                 OIDCSSLValidateServer Off
-                OIDCProviderMetadataURL https://​server.corpX.un:​8443/​realms/​corpX/​.well-known/​openid-configuration 
                 OIDCProviderMetadataURL https://​keycloak.corpX.un/​realms/​corpX/​.well-known/​openid-configuration                 OIDCProviderMetadataURL https://​keycloak.corpX.un/​realms/​corpX/​.well-known/​openid-configuration
                 OIDCRedirectURI http://​gate.corpX.un/​cgi-bin/​test-cgi                 OIDCRedirectURI http://​gate.corpX.un/​cgi-bin/​test-cgi
Line 909: Line 908:
         }         }
 } }
-</​code><​code>​+</​code>​ 
 +=== Подключение,​ тестирование,​ применение и мониторинг конфигурации === 
 +<​code>​
 # ln -s /​etc/​nginx/​sites-available/​user1 /​etc/​nginx/​sites-enabled/​user1 # ln -s /​etc/​nginx/​sites-available/​user1 /​etc/​nginx/​sites-enabled/​user1
  
 # service nginx configtest # service nginx configtest
- 
 # tail /​var/​log/​nginx/​error.log # tail /​var/​log/​nginx/​error.log
   или   или
-# nginx -t -c /​etc/​nginx/​nginx.conf+# nginx -t #-c /​etc/​nginx/​nginx.conf 
 +  или 
 +# nginx -T
  
 # service nginx restart # service nginx restart
 +
 +# tail -f /​var/​log/​nginx/​access.log -f /​var/​log/​nginx/​error.log
 </​code><​code>​ </​code><​code>​
 gate.isp.un$ wget -O - -q http://​server.corpX.un gate.isp.un$ wget -O - -q http://​server.corpX.un
Line 939: Line 943:
         location / {         location / {
             proxy_pass http://​myapp1;​             proxy_pass http://​myapp1;​
- 
-#            proxy_set_header Host            $host; 
-#            proxy_set_header X-Forwarded-For $remote_addr;​ 
- 
         }         }
     }     }
-</​code><​code>​ 
-# ln -s /​etc/​nginx/​sites-available/​myapp1 /​etc/​nginx/​sites-enabled/​myapp1 
 </​code>​ </​code>​
 +
 +  * [[#​Подключение,​ тестирование,​ применение и мониторинг конфигурации]]
  
 ==== Прокси "​красивого"​ URL в приложение (пример 3) ==== ==== Прокси "​красивого"​ URL в приложение (пример 3) ====
Line 1010: Line 1010:
 root@server#​ gitlab-ctl restart nginx root@server#​ gitlab-ctl restart nginx
 </​code>​ </​code>​
 +
 +==== HTTPS Прокси (пример 4) ====
 +
 +<​code>​
 +gate1.corp13.un:​~#​ cat /​etc/​nginx/​sites-available/​gowebd
 +</​code><​code>​
 +    server {
 +        listen 80;
 +        server_name gowebd.corp13.un;​
 +        return 301 https://​gowebd.corp13.un$request_uri;​
 +    }
 +
 +    server {
 +        listen 443 ssl;
 +        server_name gowebd.corp13.un;​
 +        ssl_certificate /​root/​gowebd.crt;​
 +        ssl_certificate_key /​root/​gowebd.key;​
 +
 +        location / {
 +            proxy_pass http://​192.168.13.64;​
 +
 +#            proxy_set_header Host            $host;
 +#            proxy_set_header X-Forwarded-For $remote_addr;​
 +
 +#            proxy_set_header X-Forwarded-Proto $scheme;
 +#            proxy_set_header X-Forwarded-Port $server_port;​
 +        }
 +    }
 +</​code>​
 +
 +
 +  * [[#​Подключение,​ тестирование,​ применение и мониторинг конфигурации]]
 +
 +===== Нагрузочное тестирование =====
 +
 +  * [[Сервис INETD]]
 +
 +  * [[https://​github.com/​wg/​wrk|wrk - a HTTP benchmarking tool]]
 +
 +  * [[https://​lindevs.com/​install-vegeta-on-ubuntu|Install Vegeta on Ubuntu 20.04]]
 +  * [[https://​github.com/​tsenart/​vegeta/​releases|github/​tsenart/​vegeta/​releases]]
 +  * [[https://​val.bmstu.ru/​unix/​WWW/​vegeta_12.11.0_linux_amd64.tar.gz]]
 +
 +<​code>​
 +external-host#​ curl http://​192.168.13.10:​8000
 +
 +external-host#​ echo "GET http://​192.168.13.10:​8000"​ | vegeta attack -duration=20s -rate=100 | vegeta report
 +
 +server# tail -f /​var/​log/​syslog
 +</​code>​
 +
сервис_http.1707829482.txt.gz · Last modified: 2024/02/13 16:04 by val