Nginx SSL with tomcat (moqui) can't run moqui with https address stably -


i have nginx ssl in front of tomcat 8 , moqui inside of tomcat.

the webapp part in moqui conf file

<webapp name="webroot" http-port="" https-enabled="false">     <root-screen host=".*" location="component://webroot/screen/webroot.xml"/> </webapp> 

the nginx conf 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 working tomcat (moqui) have https:// address resources.

but strange pattern on addresses. every 3 times refreshing page (e.g. login), once right on https:// address, other 2 times http://. if refresh page fast, pattern changes, 1 or 2 times http://, once https://. when https:// page , links on pages https, goes http when click through link on page.

i run nginx 1.8.0 , tomcat 8 moqui 1.6.2. don't know if run problem well. , can't tell whether issue nginx , tomcat, or moqui. appreciate idea.

what trying do, go through https (except screens set not require it)?

if webapp.@https-enabled should true, , best results in url generation should tell http/https ports (if no 80/443) , http/https hosts (all in attributes on webapp element).

if problem not in url generation or forwarding https non-secure requests when https required screen (which webapp element settings for) may have issues nginx or tomcat configuration.


Comments