Gitea Proxy not working for SSH

I am using the Gitea Subdomain config and I am not able to get SSH working. I know the configurations for the SSH and Gitea is correct because I am able to ssh and authenticate via LAN.

When I try to ssh (on port 8523) from my swag domain, I keep getting a connection refused. I was able to get it to work when I added a DNS rewrite to point to my gitea host instead of swag host. However this breaks access to the webUI since my swag host is different than my gitea host

What is the best way to forward/redirect SSH traffic for gitea subdomain to go to port 8523 instead?
I am making the ssh request with the following command: git clone

current gitea subdomain site conf:

## Version 2022/09/08
# make sure that your dns has a cname set for gitea and the following parameters in /data/gitea/conf/app.ini are edited
# [server]
# SSH_DOMAIN       =
# ROOT_URL         =
# DOMAIN           =

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name gitea.*;

    include /config/nginx/sslsimple.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app;
        set $upstream_port 3000;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;


you cannot reliably proxy ssh with nginx

Thank you for your response. If I wanted to still set it up, is it possible? I googled some but I could not get it work using stream

That was already answered, you can’t reliably do so.

Ok thanks, I will think of an alternate method

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.