1
我正在使用haproxy将端口转发到Bitbucket服务器ssh。下面是HAProxy的配置:用于bitbucket服务器的Haproxy配置
frontend sshd
bind *:7999
default_backend ssh
timeout client 1h
backend ssh
mode tcp
server localhost-bitbucket-ssh 127.0.0.1:7999 check port 7999
但是,如果我这样做:
sudo haproxy -f haproxy.cfg
我收到以下错误:
[ALERT] 305/201411 (4168) : http frontend 'sshd' (haproxy.cfg:38) tries to use incompatible tcp backend 'ssh' (haproxy.cfg:43) as its default backend (see 'mode').
[ALERT] 305/201411 (4168) : Fatal errors found in configuration.
但我指的是官方Atlassian的指南:https://confluence.atlassian.com/bitbucketserver/setting-up-ssh-port-forwarding-776640364.html是他们错误?
另外,如果我在bitbucket服务器之前启动haproxy,bitbucket服务器无法启动端口7999.我完全困惑。我已经付过了软件,现在我需要找出自己如何配置它超过2天...
UPDATE
这是UFW为Thomj提及。但为什么我需要haproxy?如果我无法将Bitbucket的ssh绑定到22端口?我不喜欢设置端口号。
谢谢,我以前试过,但它开始抱怨绑定套接字0.0.0.0:7999。试过'''netstat -apn | grep“:7999”'''它向我展示了java(bitbucket服务器)。所以haproxy不会让bitbucket使用端口7999? –
您只能将一个进程绑定到端口。在这种情况下,HAProxy和Bitbucket Server都尝试绑定到7999.您必须将其中一个配置为使用其他端口。 – thomj
好吧,如果我更改bitbucket上的端口,我必须在haproxy中编写什么? –