Forum Discussion

sachinratnawat's avatar
sachinratnawat
Copper Contributor
Jul 25, 2024

SFTP enabled Storage Account Behind Nginx Reverse Proxy

I am trying to put SFTP enabled storage Account behind nginx proxy. 

I tried with the below configuration in nginx.conf

stream {
    upstream backend{
        server <<storageAccount_private_ip>>:22;
 
    }
    server {
listen 22;
        proxy_pass backend;
    }
}



nginx service won't restart as port 22 is already in use for SSH. 

Can someone help me?

2 Replies

  • sachinratnawat 

    The simplest solution is to change the port that SSH listens on.

    Port 2222  # Or any other unused port

    Alternatively, you can change the port that Nginx listens on for SFTP traffic.

    stream {
      upstream backend {
        server <<storageAccount_private_ip>>:22; 
      }
      server {
        listen 2223;  # Or any other unused port
        proxy_pass backend;
      }
    }

     

Resources