1 I have a private ikiwiki (3.20170111) which is running on a host that serves HTTP and HTTPS, but ikiwiki is configured for (and only served on) HTTPS:
3 url: https://redacted/phd/
4 cgiurl: https://redacted/phd/cgi
6 However, form submissions from ikiwiki are going to a HTTP URL and thus not being served. Example headers from submitting a comment:
10 Request URL:https://redacted/phd/cgi
13 Remote Address:redacted:443
14 Referrer Policy:no-referrer-when-downgrade
20 Date: Fri, 08 Dec 2017 11:53:35 GMT
22 Connection: keep-alive
24 Location: http://redacted/phd/blog/38th_Dec/?updated#comment-bd0549eb2464b5ca0544f68e6c32221e
26 The CGI is served by lighttpd, but the whole site is front-ended by nginx, which reverse-proxies to lighttpd.
30 I think this might be to do with nginx not rewriting POST URLs when reverse-proxying, but I'm not sure why
31 they would be generated in an HTTP form in any case, except perhaps by lighttpd's CGI handler since the back
32 end is HTTP. A workaround is for nginx to redirect any HTTP URI to the HTTPS equivalent. I initially disabled
33 that so as to have the path for letsencrypt negotiation not redirected.-- [[Users/Jon]]
35 > Do you have the `reverse_proxy` option set to 1? (It affects how ikiwiki generates
36 > self-referential URLs).
38 > Is the connection between nginx and lighttpd http or https?
40 > I think this is maybe a bug in `IkiWiki::redirect` when used in conjunction with
41 > `reverse_proxy: 1`. I'm in the process of adding a test case in `t/relativity.t`.
43 > Assuming nginx has a reasonable level of configuration, you can redirect http to https
44 > for the entire server except `/.well-known/acme-challenge/` as a good way to bootstrap
45 > ACME negotiation. --[[smcv]]