# 503 error nginx

**URL:** <https://gramps.discourse.group/t/503-error-nginx/4817>\
**Category:** Gramps Web\
**Created:** [February 6, 2024, 5:16pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817 "2024-02-06T17:16:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 6, 2024, 5:16pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/1 "2024-02-06T17:16:52Z")

</div>

First, please excuse my frequent posts, that may often seen a bit bizzare. Thanks for the tolerance.

Have docker/let’s encrypt version of docker-control.yml working (again).

Now Loads without complaint, but receive “503 Error” nginx.

![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/b/b38febe8043d45cea73f156878d7d7e5aee8eb83.png)

This is either via IP or site name (local dns in use) http or https.

This is what I have been working with, installed on a Pi4b, for testing:

Gramps 5.1.6  
Gramps Web API 1.5.1  
Gramps Web Frontend 24.1.2  
locale: en  
multi-tree: false  
task queue: true

---

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [February 6, 2024, 6:27pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/2 "2024-02-06T18:27:58Z")

</div>

503 always signals an incorrect setup of the reverse proxy (nginx, domain, etc.), so requests are not even routed to Gramps Web.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 6, 2024, 6:48pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/3 "2024-02-06T18:48:06Z")

</div>

I gathered that. The question is, how do I determine what is wrong?

All I have to go on is what is provided in the documentation and the provided docker-compose.yml file and what I can scrounge up on the internet.

There are only, far as I can tell, a few things for me to specify and I think those are correct.

Attempting to “surf” my way to a solution, I see referenced to the docker command “export” as in, I guess, making a port visible to other containers, or to nginx-proxy, but I see none in the docker-compose.yml file.

I can post the file I am using, if someone cares to review it. Or provide it in some other way if more appropriate.

BTW, I am no longer receiving email notification of replies to my posts.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 6, 2024, 7:30pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/4 "2024-02-06T19:30:05Z")

</div>

> [@DavidMStraub](#):
>
> 503 always signals an incorrect setup of the reverse proxy (nginx, domain, etc.), so requests are not even routed to Gramps Web.

I find I can access grampsweb via “[mydomain.com](http://mydomain.com)”, but not “[www.mydomain.com](http://www.mydomain.com)” or, “ipaddress”.

Below is a snippet of the file containing my edits. The other local edits worked in the non proxy configuration. I did try "GRAMPSWEB\_BASE\_URL:“[www.mydomain.com](http://www.mydomain.com)” with no apparent change in response.

version: “3.7”

services:  
grampsweb: &grampsweb  
container\_name: grampsweb  
image: [Package grampsweb · GitHub](http://ghcr.io/gramps-project/grampsweb:latest)  
restart: always  
environment: &grampsweb-env  
GRAMPSWEB\_TREE: “Gramps Web” # will create a new tree if not exists  
VIRTUAL\_PORT: “5000”  
VIRTUAL\_HOST: “[mydomain.com](http://mydomain.com)” # e.g. [gramps.mydomain.com](http://gramps.mydomain.com)  
LETSENCRYPT\_HOST: “[mydomain.com](http://mydomain.com)” # e.g. [gramps.mydomain.com](http://gramps.mydomain.com)  
 LETSENCRYPT\_EMAIL: “[joea@my-email.com](mailto:joea@my-email.com)” # your email  
GRAMPSWEB\_CELERY\_CONFIG\_\_broker\_url: “redis://grampsweb\_redis:6379/0”  
GRAMPSWEB\_CELERY\_CONFIG\_\_result\_backend: “redis://grampsweb\_redis:6379/0”  
GRAMPSWEB\_RATELIMIT\_STORAGE\_URI: redis://grampsweb\_redis:6379/1  
GRAMPSWEB\_EMAIL\_USE\_TLS: “false”  
GRAMPSWEB\_EMAIL\_HOST: “[mail.someplace.com](http://mail.someplace.com)”  
GRAMPSWEB\_EMAIL\_HOST\_USER: “[admin@mydomain.com](mailto:admin@mydomain.com)”  
GRAMPSWEB\_EMAIL\_PORT: 587  
GRAMPSWEB\_EMAIL\_HOST\_PASSWORD: “SoMeWoRd”  
GRAMPSWEB\_DEFAULT\_FROM\_EMAIL: “[admin@mydomain.com](mailto:admin@mydomain.com)”  
 GRAMPSWEB\_BASE\_URL: “[mydomain.com](http://mydomain.com)”

---

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [February 6, 2024, 8:11pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/5 "2024-02-06T20:11:56Z")

</div>

> [@joea](#):
>
> All I have to go on is what is provided in the documentation and the provided docker-compose.yml file and what I can scrounge up on the internet.

The provided docker-compose file is a combination of several open source services of which Gramps Web is only one. If you are facing issues already with the nginx Proxy, it might be worth checking [their documentation](https://github.com/nginx-proxy/nginx-proxy). You should also use `docker-compose logs ...` to look at the logs of all the services, that might give you a hint what is wrong.

By the way, `BASE_URL` should be a URL, i.e. start with `https://`. But that can’t be the cause of your issue.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 6, 2024, 8:59pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/6 "2024-02-06T20:59:04Z")

</div>

Should base URL be “[https://www.mydomain.com](https://www.mydomain.com)” or just “[https://mydomain.com](https://mydomain.com)”?

I found that even though [https://mydomain.com](https://mydomain.com) will bring up the registration page, [https://mydomain.com](https://mydomain.com), after presenting the certificate warning, also gives a 503 error.

Checking logs earlier did not reveal any warnings or errors, the nginx-proxy logs showing the 503 errors and/or the transactions when in worked.

There is this, but, have always seen it:

$ docker logs grampsweb\_redis  
1:C 06 Feb 2024 20:38:16.960 \* oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo  
1:C 06 Feb 2024 20:38:16.960 \* Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=1, just started  
1:C 06 Feb 2024 20:38:16.960 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

This has been once a rewarding and very painful process. More painful at the moment.

BTW there seems to be a +5 hour discrepancy in the logged time vs my server’s time (NTP in use).

---

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [February 6, 2024, 10:21pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/7 "2024-02-06T22:21:17Z")

</div>

If you specifiy [mydomain.com](http://mydomain.com) as virtual host, you have to use [https://mydomain.com](https://mydomain.com), and if you specify [www.mydomain.com](http://www.mydomain.com), you have to use [https://www.mydomain.com](https://www.mydomain.com). And of course it will not work with the IP address or the wrong subdomain.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 6, 2024, 11:27pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/8 "2024-02-06T23:27:13Z")

</div>

Thanks, that helped. By “wrong subdomain”, do you mean anything other than “[www.mydomain.com](http://www.mydomain.com)”?

That aside for now, I can now access the first run page via htttp://www.mydomain.com, but [https://www.mydomain.com](https://www.mydomain.com) produces “500 Error Internal Server Error”.

This shows in the nginx-proxy log:

nginx.1 | [www.mydomain.com](http://www.mydomain.com) 192.168.yyy.xxx - - [06/Feb/2024:23:08:32 +0000] “GET /images/favicon.ico HTTP/1.1” 200 4286 “[http://www.mydomain.com/firstrun](http://www.mydomain.com/firstrun)” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0” “172.23.0.3:5000”  
nginx.1 | [www.mydomain.com](http://www.mydomain.com) 192.168.yyy.xxx - - [06/Feb/2024:23:08:43 +0000] “GET /favicon.ico HTTP/2.0” 500 177 “[https://www.mydomain.com/firstrun](https://www.mydomain.com/firstrun)” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0” \<mark"-"

Edit: Oh dear, just noticed the GET is different as well.

Edit1: After deleting the certs stored in FF for that site, accessing https does present the certificate warning, but, upon accepting it, again presents the 500 error.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 7, 2024, 1:15pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/9 "2024-02-07T13:15:18Z")

</div>

> [@joea](#):
>
> Thanks, that helped. By “wrong subdomain”, do you mean anything other than “[www.mydomain.com](http://www.mydomain.com)”?

If I make "VIRTUAL\_HOST: “[www.mydomain.com](http://www.mydomain.com), [mydomain.com](http://mydomain.com), My\_IP\_ADDR”  
Then the grampsweb page can be reached, by entering any of those in the browser. At first I did get a 502 bad gateway, but after a few moments a reload worked fine. I did not wait long after completing “docker-compose up -d” to try it so perhaps the first try was before things settled.

No further testing was done, it was just a curiosity thing on my part.

I still get the 500 Internal server error attempting https access and have come up empty looking at logs, event within containers, and searching the internet.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 7, 2024, 2:31pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/10 "2024-02-07T14:31:47Z")

</div>

@DavidMStraub

I hope it is not “bad manners” to tag you in this fashion.

Perhaps related to my other issue(s) in this thread, I found, via “docker compose config”, that the celery container may not be inheriting values previously defined. It was my understanding that it is not necessary to repeatedly enter the values.

 ![gramps-celery](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/7/70f6add98b0e33e1e493b56ffabfa8ec6aed7cd9.png)

Thanks.

---

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [February 7, 2024, 3:06pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/11 "2024-02-07T15:06:24Z")

</div>

In the documentation, there is a YAML merge key that copies all the environment variables, but you removed that, so you have to repeat the env variables.

If you get server error 500, that’s likely raised by Gramps Web API, so please inspect its logs.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 7, 2024, 3:12pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/12 "2024-02-07T15:12:36Z")

</div>

I don’t recall removing anything, only adding. But I will check to see.

Finding some logs a challenge to locate. Those should be in the container? Will dig a bit deeper.

---

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [February 7, 2024, 3:29pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/13 "2024-02-07T15:29:23Z")

</div>

`docker-compose logs grampsweb`

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 7, 2024, 4:06pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/15 "2024-02-07T16:06:33Z")

</div>

> [@DavidMStraub](#):
>
> docker-compose logs grampsweb

Nothing noted for either http or https

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/6/6abdae5c47350242cc11ed67aef966f9517e187c.png)

For nginx-proxy I see:

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/a/a31e92be97a4357b1cf5163585e674e68ba2414e.png)

---

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [February 7, 2024, 5:13pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/16 "2024-02-07T17:13:51Z")

</div>

It doesn’t find favicon.ico.

You’re going to have to share your full configuration - sharing snippets bit by bit it’s just guesswork what’s wrong.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 7, 2024, 5:21pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/17 "2024-02-07T17:21:11Z")

</div>

Yep. The path is different between the two attempts. The successful http tries "GET /images/favicon.ico . . "

Should I just post it here, obfuscated or “as is”?

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 7, 2024, 7:00pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/20 "2024-02-07T19:00:37Z")

</div>

@DavidMStraub (tagging you only to ensure you are aware of this)

I am attempting to post with some things obfuscated.  
[docker-compose-yml-joea.html](https://gramps.discourse.group/uploads/short-url/vrHzw07PQ3nVyW6zZxWv6mMhg62.html) (4.3 KB)

---

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [February 8, 2024, 3:53pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/21 "2024-02-08T15:53:59Z")

</div>

```
  # overriding let's encrypt variables since celery is not exposed
  VIRTUAL_PORT: "5000"
  VIRTUAL_HOST: "www.my-domain.com.my-domain.com"
  LETSENCRYPT_HOST: "www.my-domain.com,my-domain.com"
  LETSENCRYPT_EMAIL: "joea@my-email.com"

```

They should all be “” as in the example file. We are copying all environment variables from the other service, but those ones have to be unset again as we DON’T want to expose the celery service. This can explain your issues.

---

<div class="post-metadata">

**Author:** ![joea](https://avatars.discourse-cdn.com/v4/letter/j/b38774/32.png) [@joea](https://gramps.discourse.group/u/joea)\
**Post date:** [February 8, 2024, 4:24pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/22 "2024-02-08T16:24:31Z")

</div>

I made those as you stated. Same problem exists,500 error, even after starting fresh, ie “docker-compose down --rmi” and “docker volume prune all” and “docker-compose up -d”.

I don’t know if this is significant, but after an evolution such as above, the first access to “[http://my-domain.com](http://my-domain.com)” produces as 502 bad gateway error for perhaps a minute or so, then will access without error. I just dismissed that as the Pi4b being slow to initialize everything.

---

<div class="post-metadata">

**Author:** ![DavidMStraub](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davidmstraub/32/7_2.png) [@DavidMStraub](https://gramps.discourse.group/u/DavidMStraub)\
**Post date:** [February 8, 2024, 4:48pm UTC](https://gramps.discourse.group/t/503-error-nginx/4817/23 "2024-02-08T16:48:29Z")

</div>

Please share the output of `docker-compose ps` as well as the logs of all containers.

[Next page](https://gramps.discourse.group/t/503-error-nginx/4817.md?page=2)
