This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
сервис_http [2024/05/05 18:37] val [HTTPS Прокси (пример 4)] |
сервис_http [2025/10/22 18:04] (current) val [HTTPS Прокси (пример 4)] |
||
|---|---|---|---|
| Line 12: | Line 12: | ||
| ===== Пример HTTP диалога ===== | ===== Пример HTTP диалога ===== | ||
| + | |||
| + | * [[Настройка терминалов]] | ||
| + | |||
| <code> | <code> | ||
| # nc -C ya.ru 80 | # nc -C ya.ru 80 | ||
| Line 30: | Line 33: | ||
| <HTML> | <HTML> | ||
| <HEAD> | <HEAD> | ||
| - | <META HTTP-EQUIV="Refresh" CONTENT="4;URL=http://google.ru"> | + | <META HTTP-EQUIV="Refresh" CONTENT="10;URL=http://specialist.ru"> |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8"> | <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8"> | ||
| </HEAD> | </HEAD> | ||
| <BODY text="blue"> | <BODY text="blue"> | ||
| + | <A HREF=https://specialist.ru/> | ||
| + | <H1>Открыть сайт Специалист</H1> | ||
| + | <IMG SRC=https://val.bmstu.ru/unix/Media/logo.gif> | ||
| + | </A> | ||
| <!-- | <!-- | ||
| THis is comment | THis is comment | ||
| --> | --> | ||
| <PRE> | <PRE> | ||
| - | text | + | текст |
| - | as | + | без авто |
| - | is | + | форматирования |
| - | </PRE> | + | </PRE |
| - | <H1>Go to Google</H1> | + | |
| - | <A HREF=https://freebsd.org/> | + | |
| - | <IMG SRC=https://www.freebsd.org/logo/logo-full.png> | + | |
| - | </A> | + | |
| </BODY> | </BODY> | ||
| </HTML> | </HTML> | ||
| Line 197: | Line 200: | ||
| ==== Использование домашних каталогов ==== | ==== Использование домашних каталогов ==== | ||
| - | * [[http://www.corpX.un/~user1/]] | + | * [[http://server.corpX.un/~user1/]] |
| === Debian/Ubuntu === | === Debian/Ubuntu === | ||
| Line 204: | Line 207: | ||
| root@server:~# service apache2 restart | root@server:~# service apache2 restart | ||
| + | |||
| + | ubuntu24# chmod 755 /home/user1 | ||
| </code> | </code> | ||
| - | |||
| - | |||
| === Debian/Ubuntu=== | === Debian/Ubuntu=== | ||
| Line 860: | Line 863: | ||
| ===== Протокол WebDAV ===== | ===== Протокол WebDAV ===== | ||
| - | ==== Ubuntu ==== | + | ==== Debian/Ubuntu ==== |
| * [[https://www.digitalocean.com/community/tutorials/how-to-configure-webdav-access-with-apache-on-ubuntu-14-04|How To Configure WebDAV Access with Apache on Ubuntu 14.04]] | * [[https://www.digitalocean.com/community/tutorials/how-to-configure-webdav-access-with-apache-on-ubuntu-14-04|How To Configure WebDAV Access with Apache on Ubuntu 14.04]] | ||
| Line 873: | Line 876: | ||
| # chown www-data /var/www/share | # chown www-data /var/www/share | ||
| - | # cat /etc/apache2/sites-available/default | + | # cat /etc/apache2/sites-available/000-default.conf |
| </code><code> | </code><code> | ||
| ... | ... | ||
| Line 962: | Line 965: | ||
| root@server# cat /var/opt/gitlab/nginx/conf/corpX.conf | root@server# cat /var/opt/gitlab/nginx/conf/corpX.conf | ||
| </code><code> | </code><code> | ||
| + | # upstream app { | ||
| + | # server 172.18.0.1; | ||
| + | # server 172.18.0.2; | ||
| + | # server 172.18.0.3; | ||
| + | # } | ||
| server { | server { | ||
| listen 80; | listen 80; | ||
| Line 968: | Line 976: | ||
| location / { | location / { | ||
| proxy_pass http://192.168.49.2:30111/; | proxy_pass http://192.168.49.2:30111/; | ||
| + | # proxy_pass http://app; | ||
| } | } | ||
| } | } | ||
| Line 1014: | Line 1023: | ||
| <code> | <code> | ||
| - | gate1.corp13.un:~# cat /etc/nginx/sites-available/gowebd | + | gate1# cat /etc/nginx/sites-available/gowebd |
| </code><code> | </code><code> | ||
| server { | server { | ||
| listen 80; | listen 80; | ||
| - | server_name gowebd.corp13.un; | + | server_name gowebd.corpX.un; |
| - | return 301 https://gowebd.corp13.un$request_uri; | + | return 301 https://gowebd.corpX.un$request_uri; |
| } | } | ||
| server { | server { | ||
| listen 443 ssl; | listen 443 ssl; | ||
| - | server_name gowebd.corp13.un; | + | server_name gowebd.corpX.un; |
| ssl_certificate /root/gowebd.crt; | ssl_certificate /root/gowebd.crt; | ||
| ssl_certificate_key /root/gowebd.key; | ssl_certificate_key /root/gowebd.key; | ||
| location / { | location / { | ||
| - | proxy_pass http://192.168.13.64; | + | |
| + | # auth_basic "Restricted area"; | ||
| + | # auth_basic_user_file /etc/nginx/auth.basic; | ||
| + | # # apt install apache2-utils; htpasswd -c /etc/nginx/auth.basic user1 | ||
| + | |||
| + | # proxy_pass http://192.168.X.10:8000; | ||
| + | # proxy_pass http://192.168.100+X.10:NNNNN; | ||
| + | # proxy_pass http://192.168.X.64; | ||
| + | |||
| + | # proxy_http_version 1.1; | ||
| # proxy_set_header Host $host; | # proxy_set_header Host $host; | ||
| + | ## proxy_set_header X-Forwarded-Host $host; | ||
| # proxy_set_header X-Forwarded-For $remote_addr; | # proxy_set_header X-Forwarded-For $remote_addr; | ||
| + | ## proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| # proxy_set_header X-Forwarded-Proto $scheme; | # proxy_set_header X-Forwarded-Proto $scheme; | ||
| + | # proxy_set_header X-Real-IP $remote_addr; | ||
| # proxy_set_header X-Forwarded-Port $server_port; | # proxy_set_header X-Forwarded-Port $server_port; | ||
| } | } | ||
| Line 1046: | Line 1067: | ||
| * [[Сервис INETD]] | * [[Сервис INETD]] | ||
| + | |||
| + | ==== curl ==== | ||
| + | |||
| + | * [[Утилита curl#Нагрузочное тестирование]] | ||
| + | |||
| + | ==== wrk ==== | ||
| * [[https://github.com/wg/wrk|wrk - a HTTP benchmarking tool]] | * [[https://github.com/wg/wrk|wrk - a HTTP benchmarking tool]] | ||
| + | |||
| + | ==== vegeta ==== | ||
| * [[https://lindevs.com/install-vegeta-on-ubuntu|Install Vegeta on Ubuntu 20.04]] | * [[https://lindevs.com/install-vegeta-on-ubuntu|Install Vegeta on Ubuntu 20.04]] | ||
| Line 1054: | Line 1083: | ||
| <code> | <code> | ||
| - | external-host# curl http://192.168.13.10:8000 | + | external-host# curl http://192.168.X.10:82 |
| - | external-host# echo "GET http://192.168.13.10:8000" | vegeta attack -duration=20s -rate=100 | vegeta report | + | external-host# echo "GET http://192.168.X.10:82" | vegeta attack -duration=20s -rate=200 | vegeta report |
| server# tail -f /var/log/syslog | server# tail -f /var/log/syslog | ||
| + | ... | ||
| + | Jan 13 06:06:55 server inetd[7962]: 82/tcp server failing (looping), service terminated | ||
| + | ... | ||
| </code> | </code> | ||
| + | |||
| + | ==== k6 ==== | ||
| + | |||
| + | * [[https://k6.io/open-source/|k6 Open Source An extensible load testing tool built for developer happiness]] | ||