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.5k3 gold badges49 silver badges91 bronze badges
asked May 24, 2024 at 8:39
2
  • 3
    Please add the nginx entry, the internal port that SQL is listening on, and the connection string used to test. Commented May 24, 2024 at 13:18
  • @SeanGallardy hanks for your feedback. I have added the nginx entry and SQL server configuration on the original post. Please help to review and let me know your feedback. Thanks in advance, Regards Commented May 28, 2024 at 8:20

1 Answer 1

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;
 }
}
answered May 29, 2024 at 11:22

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.