Hugo: Hugo baseURL HTTPS Support

Created on 27 Nov 2015  路  12Comments  路  Source: gohugoio/hugo

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!

Enhancement

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.

All 12 comments

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?

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vielmetti picture vielmetti  路  3Comments

digitalcraftsman picture digitalcraftsman  路  3Comments

kaushalmodi picture kaushalmodi  路  3Comments

crash-dive picture crash-dive  路  3Comments

mumblecrunch picture mumblecrunch  路  3Comments