# API explorer stopped working, it tries to connect to httpS://localhost

**URL:** <https://www.dolibarr.org/forum/t/api-explorer-stopped-working-it-tries-to-connect-to-https-localhost/30116>\
**Category:** Developing for Dolibarr\
**Tags:** v20, API\
**Created:** [March 19, 2025, 7:38pm UTC](https://www.dolibarr.org/forum/t/api-explorer-stopped-working-it-tries-to-connect-to-https-localhost/30116 "2025-03-19T19:38:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [March 19, 2025, 7:38pm UTC](https://www.dolibarr.org/forum/t/api-explorer-stopped-working-it-tries-to-connect-to-https-localhost/30116/1 "2025-03-19T19:38:58Z")

</div>

I recently changed 2 things, not sure which one might influence the result.

a) I changed the password on my database for the doliuser  
b) I upgraded from v20.0.2 to v20.0.4

As a result of that I had to regenerate a new API token for all my users that uses the API.

Anyway, this post is about something else, namely that today the API Explorer is not working, because it tries to connect to [httpS://localhost](httpS://localhost) which is not responding when you are running inside Dolibarrs official docker image

 ![dolibarr_api_explorer](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/3/3cdd6a30db58c0fe360384a9c2b031a6eb51222d.png)

I did not change my container configuration, I still have this environment variable

```auto
	--env DOLI_URL_ROOT="http://localhost/" \

```

It is the same from within the container

```auto
root@dolipod:/var/www/html# export | grep -i DOLI_URL_ROOT
declare -x DOLI_URL_ROOT="http://localhost/"

```

In front of my Dolibarr container I have an nginx that does reverse proxy for dolibarr and other containers. Nginx is who encrypts with HTTPS towards the internet, where as the connection between nginx and dolibarr is plain http and runs over a virtual network card.

My other containers can access the API, and if I am inside my dolibarr container and I use curl I get these results.

```auto
root@dolipod:/var/www/html# curl http://localhost/api/index.php/status ; echo ""
{"error":{"code":401,"message":"Unauthorized: Failed to login to API. No parameter 'HTTP_DOLAPIKEY' on HTTP header (and no parameter DOLAPIKEY in URL)."}}
root@dolipod:/var/www/html# 
root@dolipod:/var/www/html# curl https://localhost/api/index.php/status ; echo ""
curl: (7) Failed to connect to localhost port 443: Connection refused

```

If I go into `About Dolibarr` page under Home, Admin Tools, About Dolibarr then I see this different value for the URL Root

```auto
URL Root	dolibarr_main_url_root	http://localhost/dolibarr (currently overwritten by autodetected value: https:// ****.*****. ***** /dolibarr)

```

Why does it think it is [http://localhost/dolibarr](http://localhost/dolibarr) when I have defined it as [http://localhost/](http://localhost/) ?

And is it because it is autodetected as httpS:// … that the API explorer also uses httpS on localhost?

Why does it keep thinking that the folder is /dolibarr/? I configured it as `/`

okay, the conf.php had this value  
$dolibarr\_main\_url\_root=‘[http://localhost/dolibarr/](http://localhost/dolibarr/)’;

but once again, why does it add the /dolibarr/ when I use the global value for the container?

```auto
root@dolipod:/var/www/html# export | grep -i DOLI_URL_ROOT
declare -x DOLI_URL_ROOT="http://localhost/"

```

Changing conf.php did seem to make it stick - but it still uses httpS for the API - why?
