# ERR\_CONNECTION\_CLOSED when trying to open local site

**URL:** https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364
**Category:** Application Support
**Created:** [March 23, 2022, 10:29am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364 "2022-03-23T10:29:56Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Rachel365](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@Rachel365](https://community.kinsta.com/u/Rachel365)
#### Post date: [March 23, 2022, 10:29am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/1 "2022-03-23T10:29:56Z")

</div>

When trying to run a local site on devkinsta I am getting this error:

# This site can’t be reached

**mpdebuggin-1.local** unexpectedly closed the connection.

Try:

- Checking the connection
- Checking the proxy and the firewall
- [Running Windows Network Diagnostics](javascript:diagnoseErrors())

ERR\_CONNECTION\_CLOSED

the site worked a few days ago… not sure what changed.  
in the log file on my pc I see these errors:  
[2022-03-23 12:24:50.923] [info] [ProgressIndicator] { isFailed: false, isOpen: false }  
[2022-03-23 12:24:50.925] [info] [ProgressIndicator] { isFailed: false, isOpen: false }  
[2022-03-23 12:24:56.300] [error] Error: =[31;1mError:[0m Error establishing a database connection.  
at file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:2:890867  
at tryCatch (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:8:2491963)  
at Generator.\_invoke (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:8:2491586)  
at Generator.next (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:8:2492729)  
at asyncGeneratorStep (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:2:1003)  
at \_next (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:2:1302)  
at processTicksAndRejections (node:internal/process/task\_queues:96:5)  
[2022-03-23 12:24:56.413] [error] Error: =[31;1mError:[0m Error establishing a database connection.  
at file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:2:890867  
at tryCatch (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:8:2491963)  
at Generator.\_invoke (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:8:2491586)  
at Generator.next (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:8:2492729)  
at asyncGeneratorStep (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:2:1003)  
at \_next (file:///C:/Users/Racheli/AppData/Local/Programs/DevKinsta/resources/app.asar/dist/renderer.prod.js:2:1302)  
at processTicksAndRejections (node:internal/process/task\_queues:96:5)

How do I solve this?  
Thanks!

---

<div class="post-metadata">

### Author: ![Kevin](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/kevin/32/808_2.png) [@Kevin](https://community.kinsta.com/u/Kevin)
#### Post date: [March 23, 2022, 5:21pm UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/2 "2022-03-23T17:21:18Z")

</div>

Hi @Rachel365, welcome to DevKinsta!

Can you open Docker Desktop and maker sure and make sure all of your Containers and Apps are running?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/1X/46335b5e49ab5aeea2ab8525e87b9e7a44fd534e.png)

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [August 29, 2023, 1:59pm UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/3 "2023-08-29T13:59:59Z")

</div>

Hi! I also have this problem. All dockers are running. I also had this last week, than I deleted all DevKinsta and Docker files and I had access again, but it is not a sustainable solution. Can I get help?

---

<div class="post-metadata">

### Author: ![Alessandro](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/alessandro/32/2310_2.png) [@Alessandro](https://community.kinsta.com/u/Alessandro)
#### Post date: [August 29, 2023, 2:09pm UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/4 "2023-08-29T14:09:30Z")

</div>

Hey Angelo, can you please provide a screenshot of the error?

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [August 30, 2023, 7:33am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/5 "2023-08-30T07:33:10Z")

</div>

Hi Allesandro, it works again, very strange…  
But now I’ve another error.

When I try to open a local site, it redirects to another local site. When I close all local sites except for the one I try to open, I got this error “Site stopped by DevKinsta”.  
I checked the site url in the database, but this is correct. I also tried to close DevKinsta and Docker, but it didn’t work.

This is the log:

```auto
[2023-08-30 09:25:07.327] [info] [SiteNav]: Navbar reloaded, unread message: no
[2023-08-30 09:25:07.327] [info] [dockerUtil/getContainer] Get 'devkinsta_fpm' Docker container
[2023-08-30 09:25:07.327] [info] [isWpSite] Checking if studionul is a Wordpress site
[2023-08-30 09:25:07.329] [info] [getDbSize] update studionul site's db size
[2023-08-30 09:25:07.329] [info] [dockerUtil/getContainer] Get 'devkinsta_fpm' Docker container
[2023-08-30 09:25:07.329] [info] [ViewSite] checking wp site version
[2023-08-30 09:25:07.329] [info] [ViewSite] checking site unread emails
[2023-08-30 09:25:07.331] [info] [dockerUtil/getContainer] Get 'devkinsta_fpm' Docker container
[2023-08-30 09:25:07.333] [info] [getSiteMailbox] Update site mailbox with API query: search?kind=containing&query=studionul.local
[2023-08-30 09:25:07.340] [info] Response: 200 OK
[2023-08-30 09:25:07.340] [info] Response headers: {
  'content-type': 'application/json',
  date: 'Wed, 30 Aug 2023 07:25:07 GMT',
  'content-length': '42',
  connection: 'close'
}
[2023-08-30 09:25:07.340] [info] Response data: { total: 0, count: 0, start: 0, items: [] }
[2023-08-30 09:25:07.340] [info] [getSiteMailbox] 0 emails retrieved. for domain studionul.local
[2023-08-30 09:25:07.366] [info] [useMailhog] Mail socket opened.
[2023-08-30 09:25:07.489] [info] [containerExec] Command 'cd /www/kinsta/public/studionul && wp --allow-root --skip-themes --skip-plugins core version' on devkinsta_fpm finished with exit code 0
[2023-08-30 09:25:07.490] [info] [checkWpVersion] site's current version 6.3
[2023-08-30 09:25:07.490] [info] [checkWpVersion] site's stored version 6.3
[2023-08-30 09:25:07.490] [info] [checkWpVersion] containerExec response test true
[2023-08-30 09:25:08.077] [info] [containerExec] Command 'cd public/studionul && wp --allow-root --skip-themes --skip-plugins db size --size_format=b --url=https://studionul.local:62091' on devkinsta_fpm finished with exit code 0
[2023-08-30 09:25:08.112] [info] [containerExec] Command 'wp --allow-root --skip-themes --skip-plugins core is-installed --path=/www/kinsta/public/studionul' on devkinsta_fpm finished with exit code 0
[2023-08-30 09:25:08.112] [info] [useWordpressCheck] Studio Nul is a wp site, setting it to WP.

```

type or paste code here

```auto

```

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [August 31, 2023, 12:56am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/6 "2023-08-31T00:56:40Z")

</div>

Heya Angelo 👋

I’ve never encountered this issue (local site redirects to another local site) on my local computer/DevKinsta 🤔  
What if you try to create a new/fresh WordPress site in DevKinsta (just for testing purpose), does it load properly ? or does it also redirect to that same (another) local site ?

Perhaps you may want to check the access log file of that local site that redirects to another local site. It can be found under the `~/DevKinsta/logs` sub-folder (e.g.: _sitename\_access.log_ file).  
You can open the terminal on your local computer and try to execute this command line:  
`tail -f sitename_access.log`

then try to access that local site URL on your browser - and if it redirects to another local site, it should be logged in that site access log file - that usually will show 301 or 302 , and if you can share that to us here.

Also on your terminal on your local computer, you may want to try to execute this command line:  
`curl -Ik https://yourlocalsitename.local`  
(and provide the results to us here as well - so we will have more information/details to check further)

> When I close all local sites except for the one I try to open, I got this error “Site stopped by DevKinsta”.

I’m not sure about this, but what do you mean with **close** all local sites (and how did you do it exactly, was it just to close the browser’s tabs that opened those local sites)?

That “ **Site stopped by DevKinsta** ” usually means that the site has been stopped in DevKinsta. Perhaps you may want to check in your DevKinsta → Sites → the site name in question → Site status section (see if that site in question is stop? if that so try to click the “Start site” button and re-check on your browser).

Regards,  
Agus

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [August 31, 2023, 5:02pm UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/7 "2023-08-31T17:02:54Z")

</div>

hi Agus,

Very strange right? When I create a new environment it works.  
The access log of the website I can’t reach because it redirects is empty. Maybe because it redirects to the other local site. What can I try?

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [August 31, 2023, 5:10pm UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/8 "2023-08-31T17:10:50Z")

</div>

When I remove the environment and pull it works again, but some environments are 10gb or 5gb and will take a lot of time to pull.

---

<div class="post-metadata">

### Author: ![ZachE](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/zache/32/1683_2.png) [@ZachE](https://community.kinsta.com/u/ZachE)
#### Post date: [August 31, 2023, 11:36pm UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/9 "2023-08-31T23:36:36Z")

</div>

Hi @whadaday 👋

Can we have the curl output as @Agus mentioned? (On an environment that you can’t reach)

Except, make that:

`curl -vv -IkL https://yourlocalsitename.local`

This way we can inspect each step of the redirect and any errors or debug statements included

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [September 1, 2023, 2:21am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/10 "2023-09-01T02:21:23Z")

</div>

> [@ZachE](#):
>
> curl -vv -IkL [https://yourlocalsitename.local](https://yourlocalsitename.local)

curl -vv -IkL [https://studionul.local](https://studionul.local)

- Trying [::1]:443…
- connect to ::1 port 443 failed: Connection refused
- Trying 127.0.0.1:443…
- connect to 127.0.0.1 port 443 failed: Connection refused
- Failed to connect to studionul.local port 443 after 4 ms: Couldn’t connect to server
- Closing connection 0  
curl: (7) Failed to connect to studionul.local port 443 after 4 ms: Couldn’t connect to server

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [September 1, 2023, 2:55am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/11 "2023-09-01T02:55:31Z")

</div>

Thank you for your reply Agelo!

Based on that curl report you provide, looks like your local site(s) in DevKinsta was not set with the default/standard ports (HTTP = 80 , HTTPS = 443 ) .

Could you please check on your _DevKinsta → Settings_ (the icon on the bottom left side) → scroll down and local the “_Port selector_” and un-check the “_[] Auto-detect open ports_”-\> set the _HTTP_ field with _80_ and set the _HTTPS_ field with _443_ and click the “_Confirm_” button.

After that on your DevKinsta, click on the Sites → the sitename of studionul.local → and locate the SSL and HTTPS, and make sure that the “HTTPS” toggle has been enabled (to ensure this site will be accessible through https:// protocol).

Then, please try to access that local site URL [https://studionul.local](https://studionul.local/) on your browser (in incognito mode just to be sure) - and see if it’s loading properly (and not redirecting to any other local site)?

Please also test with CURL again: `curl -vv -IkL https://studionul.local`  
and give us the results from it (in case it’s still redirecting , so we can check / review ).

Regards,  
Agus

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [September 1, 2023, 3:22am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/12 "2023-09-01T03:22:21Z")

</div>

Hi Agus,

When I try to change the ports it says that the ports 80/443 are already being used.  
The auto selected ports are 62090/62091.

I am also using LocalWP for my non Kinsta projects. Could there be conflicts?

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [September 1, 2023, 4:08am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/13 "2023-09-01T04:08:16Z")

</div>

I see, yeah if you have any other web server/service runs on your local computer (and they use the same standard or default ports 80/443) then those ports can’t be used again (would be conflicted) by NGINX in DevKinsta or vice-versa (if those have been used by NGINX in DevKinsta, the same ports can’t be used by the other web servers).

In this case, since the ports used/assigned were: 62090 (HTTP) and 62091 (HTTPS) - as shown in your DevKinsta’s settings (Port Selector), then if you would like to access your DevKinsta’s local sites , you would need to add the port as well in the URL (on your browser) such as for example:

`http://studionul.local:62090`  
`https://studionul.local:62091` (when HTTPS/SSL has been enabled for this site)

see if the URLs above work fine on your browser (and if those are not redirecting to any other local site?)

And for the CURL command line, that would be like this for example to test/check the results:  
`curl -vv -IkL https://studionul.local:62091`

I’ve never used LocalWP before, so not quite sure if it would conflict with DevKinsta’s local sites (and if that’s the case here with the site being redirected to another local site).  
For testing purpose, you may want to try to close LocalWP software completely (and make sure its web service is completely shutdown as well), and try to set the default ports mentioned before in your DevKinsta’s settings ( Port Selector ) and see if the local site(s) can be accessed just fine as well without additional custom port mentioned above.

Regards,  
Agus

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [September 1, 2023, 4:54am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/14 "2023-09-01T04:54:07Z")

</div>

Hi Agus,

```auto
curl -vv -IkL https://houseofdeeprelax.local:62091
* Trying [::1]:62091...
* Connected to houseofdeeprelax.local (::1) port 62091 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN: server accepted h2
* Server certificate:
* subject: CN=danielnogueira.local; C=US; ST=CA; L=West Hollywood; O=Kinsta; OU=DevKinsta
* start date: Aug 31 17:03:39 2023 GMT
* expire date: Aug 28 17:03:39 2033 GMT
* issuer: CN=danielnogueira.local; C=US; ST=CA; L=West Hollywood; O=Kinsta; OU=DevKinsta
* SSL certificate verify ok.
* using HTTP/2
* h2 [:method: HEAD]
* h2 [:scheme: https]
* h2 [:authority: houseofdeeprelax.local:62091]
* h2 [:path: /]
* h2 [user-agent: curl/8.1.2]
* h2 [accept: */*]
* Using Stream ID: 1 (easy handle 0x7fda52012800)
> HEAD / HTTP/2
> Host: houseofdeeprelax.local:62091
> User-Agent: curl/8.1.2
> Accept: */*
> 
< HTTP/2 200 
HTTP/2 200 
< server: nginx
server: nginx
< date: Fri, 01 Sep 2023 04:43:04 GMT
date: Fri, 01 Sep 2023 04:43:04 GMT
< content-type: text/html; charset=UTF-8
content-type: text/html; charset=UTF-8
< link: <https://danielnogueira.local:62091/wp-json/>; rel="https://api.w.org/"
link: <https://danielnogueira.local:62091/wp-json/>; rel="https://api.w.org/"

< 
* Connection #0 to host houseofdeeprelax.local left intact

```

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [September 1, 2023, 6:06am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/15 "2023-09-01T06:06:35Z")

</div>

Thanks Angelo for that curl results!

That’s strange indeed, as you requested to call https:// **houseofdeeprelax.local** :62091  
but the server certificate somehow shows/returns different local site name/url ( `danielnogueira.local` ) instead:

> - Server certificate:
> - subject: CN= **danielnogueira.local** ; C=US; ST=CA; L=West Hollywood; O=Kinsta; OU=DevKinsta
> - start date: Aug 31 17:03:39 2023 GMT
> - expire date: Aug 28 17:03:39 2033 GMT
> - issuer: CN= **danielnogueira.local** ; C=US; ST=CA; L=West Hollywood; O=Kinsta; OU=DevKinsta
> - SSL certificate verify ok.

and it actually didn’t redirect (301/302) to the `danielnogueira.local` site either, but just returned with the _HTTP 200 response_ ( `HTTP/2 200 `) - though the link there also shows that another local site name:

> link: \< **[https://danielnogueira.local](https://danielnogueira.local)**:62091/wp-json/\>; rel=“[https://api.w.org/](https://api.w.org/)”

I suspect there might be something with the NGINX configs of that local sites that might have changed somehow 🤔

Could you please open terminal, and cd / go inside the : `~/DevKinsta/nginx_sites` subfolder ?  
then please perform this command: `cat houseofdeeprelax.conf` (and copy paste the results here)  
as well as to perform: `cat danielnogueira.conf` (and copy paste the results here)  
so we can check and review that to make sure they are correctly setup.  
(you may also want to compare with NGINX config file of the new site you created before - which worked fine/not redirect/load another local site)

Regards,  
Agus

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [September 6, 2023, 7:14am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/16 "2023-09-06T07:14:56Z")

</div>

Hi Agus,

hereby:

```auto
server {
  set $site_name houseofdeeprelaxcom;
  set $php_path devkinsta_fpm:9004;

  listen 52034;
  listen [::]:52034;
  listen 52035 ssl http2;
  listen [::]:52035 ssl http2;

  ssl_certificate /www/kinsta/ssl/houseofdeeprelaxcom.local.crt;
  ssl_certificate_key /www/kinsta/ssl/houseofdeeprelaxcom.local.key;

  server_name houseofdeeprelaxcom.local *.houseofdeeprelaxcom.local;
  access_log /www/kinsta/logs/houseofdeeprelaxcom_access.log main;
  error_log /www/kinsta/logs/houseofdeeprelaxcom_error.log;

  root /www/kinsta/public/houseofdeeprelaxcom;
  index index.php index.html;

  include multisite_subdir.conf;

  location / {
      try_files $uri $uri/ /index.php?$args;
  }

  location ~ \.php$ {
      fastcgi_split_path_info ^(.+?\.php)(/.*)$;
      if (!-f $document_root$fastcgi_script_name) {
        return 404;
      }
      include fastcgi_params;
      fastcgi_param PHP_ADMIN_VALUE "sendmail_from=devkinsta@houseofdeeprelaxcom.local";
      fastcgi_intercept_errors on;
      fastcgi_pass $php_path;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }
}

```

```auto
server {
  set $site_name danielnogueira;
  set $php_path devkinsta_fpm:9003;

  listen 62090;
  listen [::]:62090;
  listen 62091 ssl http2;
  listen [::]:62091 ssl http2;

  ssl_certificate /www/kinsta/ssl/danielnogueira.local.crt;
  ssl_certificate_key /www/kinsta/ssl/danielnogueira.local.key;

  server_name danielnogueira.local *.danielnogueira.local;
  access_log /www/kinsta/logs/danielnogueira_access.log main;
  error_log /www/kinsta/logs/danielnogueira_error.log;

  root /www/kinsta/public/danielnogueira;
  index index.php index.html;

  include multisite_subdir.conf;

  location / {
      try_files $uri $uri/ /index.php?$args;
  }

  location ~ \.php$ {
      fastcgi_split_path_info ^(.+?\.php)(/.*)$;
      if (!-f $document_root$fastcgi_script_name) {
        return 404;
      }
      include fastcgi_params;
      fastcgi_param PHP_ADMIN_VALUE "sendmail_from=devkinsta@danielnogueira.local";
      fastcgi_intercept_errors on;
      fastcgi_pass $php_path;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }
}

```

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [September 6, 2023, 7:21am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/17 "2023-09-06T07:21:47Z")

</div>

Hi Changed the ports to

```auto
set $php_path devkinsta_fpm:9003;

  listen 62090;
  listen [::]:62090;
  listen 62091 ssl http2;
  listen [::]:62091 ssl http2;

```

Now I get this error. This is with and without ssl activated

```auto
400 Bad Request
The plain HTTP request was sent to HTTPS port
nginx

```

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [September 6, 2023, 7:44am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/18 "2023-09-06T07:44:01Z")

</div>

Heya Angelo 🙂

Thank you for the update! Yeah the settings look a bit different for both sites.  
You may want to check the other local site’s NGINX config file as well - that’s loading/working properly (to compare and to make sure it’s also set with the same ports as set for that `danielnogueira` site).  
I checked mine and could see all of my local sites’ NGINX config files were set up with the same ports.

May I know how exactly did you change that `houseofdeeprelaxcom` NGINX .conf file ?  
Did you try to change it via DevKinsta → Sites → site name in question → click the “Wrench” icon on the left side → NGINX Editor (Save changes) section ?

Also after you changed that NGINX config file from that editor in DevKinsta, please also try to restart the NGINX docker’s container via terminal with this command;  
`docker restart devkinsta_nginx`  
then see if the site can be accessed on your browser?

Regards,  
Agus

---

<div class="post-metadata">

### Author: ![whadaday](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/whadaday/32/2194_2.png) [@whadaday](https://community.kinsta.com/u/whadaday)
#### Post date: [September 6, 2023, 8:01am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/19 "2023-09-06T08:01:28Z")

</div>

Hi Agus,

Yes it works. After I changed it, it was browser cache which led me to the 400 error page.  
Thank you for your help!

Cheers, Angelo

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [September 7, 2023, 12:50am UTC](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364/20 "2023-09-07T00:50:46Z")

</div>

Glad to hear it worked for you now Angelo! 👏 👍  
You’re always welcome! 🙇‍♂️

Regards,  
Agus

[Next page](https://community.kinsta.com/t/err-connection-closed-when-trying-to-open-local-site/1364.md?page=2)
