Kiwi icon indicating copy to clipboard operation
Kiwi copied to clipboard

Update documentation `Running Kiwi TCMS as a Docker container` to include use cases for `http->https` redirect when using custom host ports that are not `443`

Open gudrutis opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. When following the tutorial to setup KiwiTCMS using docker (described at docs/source/installing_docker.rst), I ran into an issue that I could not easily configure nginx to redirect to a different https port. As of the latest version per my understanding, there is no way to disable http->https redirect. If on a host machine, I will mount https port on a different port than 443 ( ex. the port is already taken), the http->https redirect does not know about it and sends to default https port on a host server which is still 443.

In other words, when using custom ports that are not 80 and 443, http->https redirect breaks, this situation is not documented and I had to come up with my own solution

Describe the solution you'd like This is what I did:

  • Created a copy of etc/nginx.conf as etc/nginx.conf.overwrite
  • here https://github.com/kiwitcms/Kiwi/blob/386759213fa7c1d935e04a3a899716af0eaaa193/etc/nginx.conf#L74 included port like this return 301 https://$host:2443$request_uri;
  • in https://github.com/kiwitcms/Kiwi/blob/386759213fa7c1d935e04a3a899716af0eaaa193/docker-compose.yml#L28 added line - ./etc/nginx.conf.overwrite:/Kiwi/etc/nginx.conf to overwrite nginx configuration with a new one.

Describe alternatives you've considered Building a docker image from scratch would be overkill in such a situation, in my opinion.

Additional context I am attaching screenshots to better understand what I did.

kiwi1

kiwi2

gudrutis avatar Mar 05 '24 11:03 gudrutis