0

I have a server running SQL Server 2022 with a couple of instances. There is the need to grant access to an external supplier working with us on a project. The idea is: the supplier connects to our sql server on a specific database they need to access. We have created a configuration on a proxy server running nginx that allows the connection to the local sql server. However, I cannot reach the database when testing from outside.

Is there any configuration I need to do on the SQL server to allow this hebavior?

Thanks in advance!

nginx entry

server {
        access_log /var/log/nginx/porgreencloud1433.log upstream_time;
        error_log /var/log/nginx/porgreencloud1433_error.log;
    listen 1433;
    server_name porgreencloud.company.com;

    location / {
            proxy_connect_timeout 60s;
            proxy_socket_keepalive on;
            proxy_pass http://dbtcp;
    }

    ssl_certificate /etc/letsencrypt/live/porgreencloud.company.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/porgreencloud.company.com/privkey.pem; # managed by Certbot
    include /etc/nginx/sites-available/sslsettings.conf;

}

SQL Server settings

enter image description here

enter image description here

enter image description here

Connection String

SQLUser = "ourUser"
SQLPassword = "LetsConnect2DB!!"
SQLServer = "porgreencloud.company.com,1433"
    DbConn = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=" & SQLUser & ";Password=" & SQLPassword & ";Initial Catalog=" & DBName & ";" & _
    "Data Source=" & SQLServer & ";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;" & _
    "Use Encryption for Data = False;Tag with column collection when possible=False"
Sean Gallardy
  • 38,135
  • 3
  • 49
  • 91
aganju82
  • 1
  • 1

1 Answers1

0

You're going to want something more like this for your nginx configuration. You may have to change the names to reflect proper dns entries and make sure various items are accessible from firewalls as well.

stream
{
 upstream SQLDB
 {
   server porgreencloud.company.com:1433;
 }

server { listen 1433; proxy_pass SQLDB; } }

Sean Gallardy
  • 38,135
  • 3
  • 49
  • 91