server {
listen 8080;
server_name gitlab.domen.ru gitlab.domen.ru;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name gitlab.domen.ru gitlab.domen.ru;
ssl_certificate /etc/letsencrypt/live/gitlab.domen.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/gitlab.domen.ru/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://192.168.0.26:8086; <-----------------Это сервер гитлаба
proxy_set_header Host $host;
proxy_set_header X-Real-IP $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-Host $host;
proxy_set_header X-Forwarded-Ssl on;
}
}
root@k8s-master1:~# nmap -p 443 БелыйАйпи
Starting Nmap 7.80 ( https://nmap.org ) at 2024-07-28 12:06 UTC
Nmap scan report for БелыйАйпи
Host is up (0.00079s latency).
PORT STATE SERVICE
443/tcp filtered https
Nmap done: 1 IP address (1 host up) scanned in 0.45 seconds
root@k8s-master1:~# curl -v https://gitlab.domen.ru
* Trying БелыйАйпи:443...
* connect to БелыйАйпи port 443 failed: Connection timed out
* Failed to connect to gitlab.domen.ru port 443 after 129304 ms: Connection timed out
* Closing connection 0
curl: (28) Failed to connect to gitlab.domen.ru port 443 after 129304 ms: Connection timed out
root@k8s-master1:~#
root@worker-node2:~# nmap -p 443 БелыйАйпи
Starting Nmap 7.80 ( https://nmap.org ) at 2024-07-28 12:06 UTC
Nmap scan report for БелыйАйпи
Host is up (0.00081s latency).
PORT STATE SERVICE
443/tcp filtered https
Nmap done: 1 IP address (1 host up) scanned in 0.34 seconds
root@worker-node2:~# curl -v https://gitlab.domen.ru
* Trying 192.168.0.19:443...
* Connected to gitlab.domen.ru (192.168.0.19) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: CN=gitlab.domen.ru
* start date: Jul 16 07:47:19 2024 GMT
* expire date: Oct 14 07:47:18 2024 GMT
* subjectAltName: host "gitlab.domen.ru" matched cert's "gitlab.domen.ru"
* issuer: C=US; O=Let's Encrypt; CN=R11
* SSL certificate verify ok.
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> GET / HTTP/1.1
> Host: gitlab.domen.ru
> User-Agent: curl/7.81.0
> Accept: */*
>
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Server: nginx/1.18.0 (Ubuntu)
< Date: Sun, 28 Jul 2024 12:06:12 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: no-cache
< Content-Security-Policy:
< Location: https://gitlab.domen.ru/users/sign_in
< Permissions-Policy: interest-cohort=()
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Gitlab-Meta: {"correlation_id":"01J3WKQV5YDKRWBKD0WSJJECNN","version":"1"}
< X-Permitted-Cross-Domain-Policies: none
< X-Request-Id: 01J3WKQV5YDKRWBKD0WSJJECNN
< X-Runtime: 0.028165
< X-Ua-Compatible: IE=edge
< X-Xss-Protection: 1; mode=block
< Strict-Transport-Security: max-age=63072000
< Referrer-Policy: strict-origin-when-cross-origin
<
* Connection #0 to host gitlab.domen.ru left intact
<html><body>You are being <a href="https://gitlab.domen.ru/users/sign_in">redirected</a>.</body></html>root@worker-node2:~#
root@k8s-master1:~# nmap -p 443 БелыйАйпи
Starting Nmap 7.80 ( https://nmap.org ) at 2024-07-28 10:26 UTC
Nmap scan report for БелыйАйпи
Host is up (0.0054s latency).
PORT STATE SERVICE
443/tcp filtered https
Nmap done: 1 IP address (1 host up) scanned in 5.55 seconds
root@k8s-master1:~# netstat -tuln | grep 443
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
tcp6 0 0 :::6443 :::* LISTEN
root@k8s-master1:~# systemctl status ufw
○ ufw.service - Uncomplicated firewall
Loaded: loaded (/lib/systemd/system/ufw.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:ufw(8)
{
"dns": ["8.8.8.8", "8.8.4.4"]
}
sudo docker run -d --name gitlab-runner --restart always --dns=8.8.8.8 --network bridge -v /home/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest
/ # nslookup domen1.gitlab.com
Server: 8.8.8.8
Address: 8.8.8.8:53
Non-authoritative answer:
Name: domen1.gitlab.com
Address: МойБелыйАйпиТут
Non-authoritative answer:
nslookup domen1.gitlab.com
Server: 127.0.0.53
Address: 127.0.0.53#53
Name: domen1.gitlab.com
Address: 192.168.0.19
[[runners]]
name = "shell-runner"
url = "https://domen1.gitlab.com"
token = "glrt-Yvjd-sde8u-PViNDgbuz"
executor = "shell"
environment = ["HTTP_PROXY=http://domen1.gitlab.com:443", "HTTPS_PROXY=http://domen1.gitlab.com", "NO_PROXY=localhost,127.0.0.1,domen1.gitlab.com"]
Configuration loaded builds=0 max_builds=1
listen_address not defined, metrics & debug endpoints disabled builds=0 max_builds=1
[session_server].listen_address not defined, session endpoints disabled builds=0 max_builds=1
Initializing executor providers builds=0 max_builds=1
WARNING: Checking for jobs... failed runner=Yvjd-sde8 status=couldn't execute POST against https://domen1.gitlab.com/api/v4/jobs/request: Post "https://domen1.gitlab.com/api/v4/jobs/request": dial tcp МойБелыйАйпиТут:443: i/o timeout
Configuration loaded builds=0 max_builds=1
listen_address not defined, metrics & debug endpoints disabled builds=0 max_builds=1
[session_server].listen_address not defined, session endpoints disabled builds=0 max_builds=1
Initializing executor providers builds=0 max_builds=1
WARNING: Checking for jobs... failed runner=Yvjd-sde8 status=couldn't execute POST against https://domen1.gitlab.com/api/v4/jobs/request: Post "https://domen1.gitlab.com/api/v4/jobs/request": dial tcp МойБелыйАйпиТут:443: i/o timeout
Сервер пытается установить соединение с удалённым хостом, но не получает ответов. Причина остается не известной