I am trying to return content with a web service. Behind an apache proxy if fails with "Operation insecure".
I read about adding an apache hook but it won't work for me. Setting the environment variable neither. This is what I tried: how to make Mojolicious's url_for()->to_abs() return correct scheme (http or https) behind nginx
Maybe or webservice I have to do something else ? Also I use mojolicious lite.
Also the url_for is done in the template file .html.ep. I use it to call the web service from javascript.
I run Mojolicious 7.59 on Ubuntu 18.04. Thank you for you help
I solved it this way: the apache proxy must have some specific settings and also the mojo app must be in reverse proxy mode.
Apache Settings
Apache must know how to proxy the web services and it must tell mojo about the forwarding protocol.
At /etc/apache2/sites-enabled/default-ssl.conf I changed this way:
Mojo Proxy
The mojolicious app must know it is in reverse proxy. If you are using hypnotoad it may not be necessary. When I did some tests with morbo I had to run it this way:
There is more documentation at https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Reverse-proxy