Setting Up a Gitea instance with a reverse proxy (NGINX) in docker-compose works fine for me. After logging in to the webapp creating repositories, changing settings, etc. works. Even cloning repositories via HTTPS works. However, cloning via SSH runs into
git clone git@localhost:martin/asd.git
Cloning into 'asd'...
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
How do I make process on identifying the problem? The docker-compose logs only show
production_nginx | 172.22.0.1 - - [19/Jun/2020:20:40:41 +0000] "SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3" 400 157 "-" "-"
which isn't helpful for me.
The code docker-compose file and my nginx config can be accesed via my GitHub repository
Docker-Compose.yml:
version: "2"
networks:
reverseproxy:
gitea:
external: false
services:
nginx:
image: nginx:latest
container_name: production_nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- "80:80"
- "443:443"
- "22:22"
networks:
- reverseproxy
server:
image: gitea/gitea:latest
environment:
- APP_NAME=Gitea
- USER_UID=1000
- USER_GID=1000
- DB_TYPE=postgres
- DB_HOST=db:5432
- DB_NAME=gitea
- DB_USER=gitea
- DB_PASSWD=gitea
- DOMAIN=localhost
- SSH_DOMAIN=localhost
- HTTP_PORT=80
- SSH_PORT=22
- SSH_LISTEN_PORT=22
restart: always
networks:
- gitea
- reverseproxy
volumes:
- gitea_data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
expose:
- "3000"
- "22"
depends_on:
- db
db:
image: postgres:9.6
restart: always
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=gitea
- POSTGRES_DB=gitea
networks:
- gitea
volumes:
- postgres:/var/lib/postgresql/data
volumes:
gitea_data: {}
postgres: {}
nginx.conf
events {}
http {
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://gitea_server_1:3000;
}
}
server {
listen 22;
server_name localhost;
location / {
proxy_pass http://gitea_server_1:22;
}
}
}