Hey, I'm currently developing a website with Kobwe...
# kobweb
m
Hey, I'm currently developing a website with Kobweb. Probably a pretty stupid question but how can I get an SSL certificate (from certbot) to work in my Kobweb server? I have a certificate and key file
d
Not a stupid question at all. Actually this is the first time I've seen it so I'm not sure yet. Do you have any idea how this would work if you were writing a web server (e.g. using ktor) from scratch?
What solution are you using to host your web server?
I do not yet know about about SSL configuration in ktor to know if this will be enough or not, but be sure to read this section just in case: https://github.com/varabyte/kobweb#kobweb-server-plugins
It seems like you can put this engine initialization logic in a server plug-in. https://ktor.io/docs/ssl.html#embedded-server I normally assumed SSL configuration happened one level higher (e.g. by nginx or the web host), but if it turns out this is a common thing to set up for some use cases, I can file an issue and look into exposing values in the Kobweb conf.yaml file
But for now I'd try the server plug-in approach
m
Thanks for your answer, I think doing this with nginx is best for me now. But how can I configure nginx for my kobweb server?
d
I haven't done it but you probably need to configure nginx as a reverse proxy: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
m
I managed it, thank you very much for the help!
👍 1
🙌 1
d
And then you need to run your Kobweb server, which you can do through one of the provided start web server scripts
(Those scripts can be found at
.kobweb/server/start.sh
and
.kobweb/server/start.bat
after you export your site)
c
If you want a really fast reverse proxy, you can use Caddy:
Copy code
caddy reverse-proxy --from <http://your.website.domain.com|your.website.domain.com> --to localhost:8000
d
> yes, the Kotlin plugin does a LOT of very weird stuff to intercept --continuous and do their own stuff on top of it 😕 I found their continuous logic buggy and actually have code in my project to forcefully disable it. I just checked and the associated YouTrack bug is still open.
a
I think it's better to use something reverse proxy like
Nginx
and setup ssl certificate (you can get it from Let's Encrypt using a bot by using a package in Linux server and it also has auto renew) Even the docs says in most cases your server will be behind a reverse proxy
👍 1
thank you color 1
It's deployment guide, I don't recommend it though (if you want to deploy your Ktor server), it work but it's quite outdated, has some issues and we need a better way to handle it Use it for setup nginx and ssl