Всем привет!
На одной из машин установлен сервис+nginx, который использует порты 30443+80.
На новой ВМ в той же сети устанавливаем Gitlab+nginx с портами 50443+34080
В конфигах /etc/nginx/sites-enabled/defaul изменили 80 порт на 34080
spoilerserver {
listen 34080 default_server;
listen [::]:34080 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/run/php/php7.4-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
в основном конфиге gitlab в той же директории прописали:
spoilerserver {
listen 34080;
server_name gitlab.company.ltd;
}
в etc/nginx/conf.d/gitlab прописали так же
spoilerGNU nano 6.2 gitlab_company_ltd.conf
server {
listen 34080;
server_name gitlab.company.ltd;
access_log /var/log/nginx/gitlab.access.log;
root /var/www/gitlab/public_html/;
index index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
}
Но nginx ругается
#systemctl status nginx
× nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-06-23 12:47:20 MSK; 18min ago
Docs: man:nginx(8)
Process: 1017 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
CPU: 7ms
Jun 23 12:47:20 gitlab systemd[1]: Starting A high performance web server and a reverse proxy server...
Jun 23 12:47:20 gitlab nginx[1017]: nginx: [warn] conflicting server name "gitlab.company.ltd" on 0.0.0.0:34080, ignored
Jun 23 12:47:20 gitlab nginx[1017]: nginx: [emerg] socket() [::]:34080 failed (97: Unknown error)
Jun 23 12:47:20 gitlab nginx[1017]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jun 23 12:47:20 gitlab systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jun 23 12:47:20 gitlab systemd[1]: nginx.service: Failed with result 'exit-code'.
Jun 23 12:47:20 gitlab systemd[1]: Failed to start A high performance web server and a reverse proxy server.
netstat выдает, что
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 709/nginx: master p
tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 709/nginx: master p
Где еще нужно что-то исправить что бы nginx: master слушал 34080