Can we get support for https in -b, --baseURL when using it like this hugo server -w -b //domain.com/ --appendPort=false It works just fine in config.toml baseUrl = "//domain.com/" Thank You!
Note that this task would also include setting up the server with SSL with a certificate and all that shebang.
Yeah that fine, at least will have the option :-)
@tuxy curious: How would you set up SSL _without_ a certificate?
Self-Signing and/or using CloudFlare ;-) See examples bellow.
https://github.com/tuxy/configs/blob/master/generate-ssl-keys.md
https://github.com/tuxy/configs/blob/master/nginx/nginx.conf
https://github.com/tuxy/configs/blob/master/nginx/hugo.conf
https://github.com/tuxy/configs/tree/master/hugo
Ah, OK (but self-signed is still a certificate) -- but lets just drop this issue down to be about the baseURL only, not about SSL support in the server.
@bep yes, its what I wanted ^_^ Simply support both http and https in baseURL by adding it in config line such as baseURL = "domain.com" for example, instead of having to use // two forward-slashes.
I don't know what kind of work would need to be done, but Caddy server supports Lets Encrypt, and it works pretty slick. I think the source code for how it works can be found here, although I'm not sure how much of that is tied to Caddy-specific implementation.
I'm taking a look at this now, new to this but I want to try to help out for once ^_^ To clarify @bep, this is just dealing with baseURL in the commands package?
@stuartweir yes.
It seems to me that baseUrl just disregards the protocol.
I've tried to use https (i redirect http to https, if you need a free cert try letsencrypt) but the url was still using http.
Using "/" works but then the sitemaps are broken because the path are relative, and at least in google webmaster tools it doesn't work :(
+1
Hard coding the URL into a config file makes it hard to support cloud environments for a number of reasons. One being that https may be provided by a proxy server.
Special thanks to @moorereason for solving this issue in PR#2144.
Merged as ca6b26f.
Most helpful comment
+1
Hard coding the URL into a config file makes it hard to support cloud environments for a number of reasons. One being that https may be provided by a proxy server.