The problem is NOT about how to setup apache to redirect http to https. I am already doing that. But, in fact, it was such a redirection, combining with the unfortunate fact that web2py's URL(..., scheme=True) still generating "http://..." links, causing my RESTful API to malfunction. Who would know an http PUT request would lost its http body after a redirection? Nonetheless, in my previous post, I already narrowed down to the root cause, and asked: why URL(..., scheme=True) is currently implemented as detecting wsgi_url_scheme env var, rather than simply relying on the more sophisicated request.is_https?
Regards,
Ray