I have nginx with ssl in front of tomcat 8 and moqui is inside of tomcat.
The webapp part in moqui conf file is
<webapp name="webroot" http-port="" https-enabled="false">
<root-screen host=".*" location="component://webroot/screen/webroot.xml"/>
</webapp>
The nginx conf for ssl header
proxy_set_header Accept-Encoding "";
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
Tomcat add RemoteIpValve
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="192\.168\.1\.14|127\.0\.0\.1"
remoteIpHeader="x-forwarded-for"
remoteIpProxiesHeader="x-forwarded-by"
protocolHeader="x-forwarded-proto"
/>
This should be working for tomcat (moqui) to have https:// address for all resources.
But I get a strange pattern on addresses. every 3 times refreshing a page (e.g. Login), I get once right on https:// address, the other two times get http://. If I refresh page very fast, then the pattern changes, one or two times with http://, then once with https://. When it is https:// page and links on the pages are also https, it goes to http when click through a link on the page.
I run nginx 1.8.0 and tomcat 8 with moqui 1.6.2. I don't know if anyone run into this problem as well. And I can't tell whether it is issue with nginx and tomcat, or something with moqui. Very appreciate for any idea.