<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I believe you have to tell Wildfly to listen for proxied connections. In standalone/configuration/standalone.xml change:<div class=""><br class=""></div><div class=""><http-listener name="default" socket-binding="http" redirect-socket="https”/></div><div class=""><br class=""></div><div class="">to</div><div class=""><br class=""></div><div class=""><http-listener name="default" socket-binding="http" redirect-socket=“https” proxy-address-forwarding="true"/></div><div class=""><br class=""></div><div class="">Hope that helps. If not, check your nginx error log.</div><div class=""><br class=""><div class="">
<div class="">Scott Rossillo</div><div class="">Smartling | Senior Software Engineer</div><div class=""><a href="mailto:srossillo@smartling.com" class="">srossillo@smartling.com</a></div><div class=""><br class=""></div><div class=""><a href="https://app.sigstr.com/uc/55e5d41c6533390d03580000" id="campaignblock" target="_blank" style="box-sizing: border-box; color: rgb(0, 75, 118); outline-offset: -2px; font-family: gesta, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; widows: 1; background-color: rgb(255, 255, 255); outline: 0px !important;" class=""><img alt="Latest News + Events" border="0" src="https://app.sigstr.com/uc/55e5d41c6533390d03580000/img" style="box-sizing: border-box; border: 0px; vertical-align: top; max-width: 100%; height: auto; width: inherit; color: blue; font-family: Helvetica; font-size: 12px;" class=""></a><span style="color: rgb(169, 169, 169); font-family: gesta, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; widows: 1; background-color: rgb(255, 255, 255);" class=""></span><div id="watermark" style="box-sizing: border-box; color: rgb(169, 169, 169); font-family: gesta, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; widows: 1; background-color: rgb(255, 255, 255);" class=""><a href="http://www.sigstr.com/" style="box-sizing: border-box; color: rgb(0, 124, 194); text-decoration: none; background-color: transparent; outline: 0px !important;" class=""><img alt="Powered by Sigstr" border="0" src="https://app.sigstr.com/uc/55e5d41c6533390d03580000/watermark" style="box-sizing: border-box; border: 0px; vertical-align: top; max-width: 100%; height: auto; width: inherit; color: rgb(99, 99, 99); font-family: Helvetica; font-size: 11px;" class=""></a></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Jan 13, 2016, at 12:28 AM, Adrian Matei <<a href="mailto:adrianmatei@gmail.com" class="">adrianmatei@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Can anyone help me with a configuration of keycloak (port 8180) and tomcat (port 8080) running on the same host/domain having nginx as reverse proxy server in front of it (new to nginx). <div class=""><br class=""></div><div class="">Accessed on individual ports they run perfectly but when going over nginx, tomcat address (localhost) works but keycloak (localhost/auth) won't.</div><div class=""><br class=""></div><div class="">Here's my nginx configuration:</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><div class="">user www-data;</div></div><div class=""><div class="">worker_processes 4;</div></div><div class=""><div class="">pid /run/nginx.pid;</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class="">events {</div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>worker_connections 1024;</div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span># multi_accept on;</div></div><div class=""><div class="">}</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class="">http {</div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>server_tokens off; #hides nginx version and OS running on</div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>include /etc/nginx/mime.types;</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>upstream tomcat_server {</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>server localhost:8080;</div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>}</div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>upstream keycloak_server {</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>server localhost:8180;</div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>}</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>server {</div></div><div class=""><div class=""><span class="" style="white-space:pre">                </span>listen 80;</div></div><div class=""><div class=""><span class="" style="white-space:pre">                </span>server_name localhost;</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""><span class="" style="white-space:pre">                </span>location / {</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>try_files $uri $uri/index.hml /maintenance.html @tomcat;</div></div><div class=""><div class=""><span class="" style="white-space:pre">                </span>}</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""><span class="" style="white-space:pre">                </span>location @tomcat {</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>proxy_pass <a href="http://tomcat_server/" class="">http://tomcat_server</a>;</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>proxy_set_header Host $host; </div></div><div class=""><div class=""><span class="" style="white-space:pre">                </span>}</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""><span class="" style="white-space:pre">                </span> location /auth/ {</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>proxy_pass <a href="http://keycloak_server/" class="">http://keycloak_server</a>;</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>proxy_set_header Host $host;</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>proxy_set_header X-Real-IP $remote_addr;</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div></div><div class=""><div class=""><span class="" style="white-space:pre">                        </span>proxy_set_header X-Forwarded-Proto $scheme;</div></div><div class=""><div class=""> }</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""><span class="" style="white-space:pre">        </span>}</div></div><div class=""><div class="">}</div></div></blockquote><div class=""><div class=""><span class="" style="white-space:pre">                        </span></div></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Adrian</div></div>
_______________________________________________<br class="">keycloak-user mailing list<br class=""><a href="mailto:keycloak-user@lists.jboss.org" class="">keycloak-user@lists.jboss.org</a><br class="">https://lists.jboss.org/mailman/listinfo/keycloak-user</div></blockquote></div><br class=""></div></body></html>