-
Hello, I'm trying to set up TLS in my self-hosted umami server. I couldn't figure out how to allow access on custom directories in "public" dir. Umami is currently installed on my Nginx Unit server as a proxy. I've already tried to allow it through Unit's configuration file by adding "routes": [
{
"match": {
"host": "umami.example.com"
},
"action": {
"proxy": "http://127.0.0.1:4000"
}
},
{
"match": {
"uri": "/.well-known/acme-challenge/*"
},
"action": {
"share": "/root/umami/public/"
}
}
] But the certbot couldn't reach the "/.well-known/" dir. I also tried to create custom directory called "test" in public dir and put some images in there but I also couldn't reach these files via URL Sorry if this is a super basic question. I am fairly new at nextjs applications and I wonder if I'm missing something, should I change something in umami's source codes to allow it? I'd really appreciate your help. 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 6 replies
-
Hi essovius, happy to help you out here. Can you share the rest of your configuration, if there is more to it? Have you been following our Certbot guide? I assume you're attempting to get a certificate for umami.example.com, correct? I believe the issue is that the first "routes": [
{
"match": {
"uri": "/.well-known/acme-challenge/*"
},
"action": {
"share": "/root/umami/public/"
}
},
{
"match": {
"host": "umami.example.com"
},
"action": {
"proxy": "http://127.0.0.1:4000"
}
}
] The problem is that routes are matched in order, so if Let's Encrypt's servers are making a request to umami.example.com/.well-known/acme-challenge/, the host (umami.example.com) is matched first and the share action is ignored. However, as shown in the guide I linked above you may want to separate your Certbot routes from your proxy routes. I can help you with that too. |
Beta Was this translation helpful? Give feedback.
-
Does adding "action": {
"share": "/root/umami/public$uri"
} See here, the way |
Beta Was this translation helpful? Give feedback.
-
Does Unit have access to |
Beta Was this translation helpful? Give feedback.
-
Might be worth enabling router diagnostic logging to see exactly what's going on, especially with the mix of
|
Beta Was this translation helpful? Give feedback.
-
Check the perms on the |
Beta Was this translation helpful? Give feedback.
-
The error is pretty clear...
That's from the unit log you posted. Please post the output of # ls -ld /root /root/umami /root/umami/public /root/umami/public/test
# ls -l /root/umami/public/test/test.txt
I would say using |
Beta Was this translation helpful? Give feedback.
-
It could also be being blocked by the likes of selinux or apparmour... what distribution you using? I'm assuming some flavour of Linux. But let's see what |
Beta Was this translation helpful? Give feedback.
The error is pretty clear...
That's from the unit log you posted.
Please post the output of
# ls -ld /root /root/umami /root/umami/publi…