${base.url} and ${server.url} where are these variables set?

Diogo Thomaz shared this question 10 months ago
Answered

Hello,

Anyone knows where the variables ${base.url} and ${server.url} are defined in YF?

Comments (8)

photo
1

Hi Diogo,

Thanks for reaching out. Can you please indicate where in YF you're looking to see '${base.url}' and '${server.url}'?

Thanks,

Mike

photo
1

Here in these files:

appserver/webapps/ROOT/js/jsapi/base.js

appserver/webapps/ROOT/js/externaljs/base.js


appserver/webapps/ROOT/js/externaljs/server_replacements.js

Here the variables baseURL and serverURL are set with ${base.url} and ${server.url} but I can't see where these variables are set.

When I changed the files to use the actual urls I wanted I still got an error on my browser where serverURL was http and not https as I set in these 3 files. So, I imagine that the serverURL file is being set somewhere else using ${server.url}...

Does this make sense?

Regards,

Diogo

photo
1

Hi Diogo,

Thanks for specifying. I've reached out to the Consulting Team regarding this and am waiting to hear back. I suspect the baseURL value is being pulled from External Instance Base URL under Admin > System > General Settings, but I'm not sure about serverURL.

Either way, it may be worth checking how your External Instance Base URL is configured in the location above in the meantime to see if that sparks any solutions and/or confirms that this is indeed where the baseURL value is coming from. I do want to point out though that Consulting is very busy this week and this may wind up being a better question for dev), so there might be a slight delay in response, but I hope to have something more for you shortly nevertheless.

Regards,

Mike

photo
1

Thanks Mike.

The external instance Base URL is correctly set with https://

Let's wait for feedback from the dev team.

Regards,

Diogo

photo
1

Hi Diogo,

Thanks for confirming. I'll let you know as soon as I hear back.

Regards,

Mike

photo
1

Hi Diogo,

I've received some feedback on this:

These are set in whatever page you are calling the JsAPI from, based off the source URL you provide:


<script src="http://neal-dennis:8080/JsAPI/v3";; type="text/javascript"></script>

For a page using the above example, in the browser console, typing yellowfin.serverURL will give you http://neal-dennis:8080, while baseURL will give you the full http://neal-dennis:8080/JsAPI/v3


So if you are seeing HTTP in the URL, it's possible you're calling from HTTP. I have tested locally using https and it seems to work:

/2ecf4d741c06925c86160a93456c818a

That said, I also received the following feedback from the dev team:

"It's possible that it is a proxy issue. Where they are requesting HTTPS to the proxy and that is forwarding to the tomcat server as HTTP. With tomcats proxy settings you can configure this.


We had this issue with our docker containers where the scheme of the request wasn't being set correctly so you would hit "https://neds-server/JsAPI/v3"; and get "http://neds-server"; as the Server URL..

We fixed that by making sure the proxyPort and proxyName and scheme were all being applied in the appserver/conf/server.xml.

So it might just be a case of adding a scheme to the connector with the proxy config."


Hopefully this helps! Please take a look into these possibilities and let me know what you find.

Regards,

Mike

photo
1

Hello Mike,

This has been resolved by adding

proxyName="yellowfin.aquanetix.co.uk" proxyPort="443" scheme="https" secure="true"

to the server.xml connector definition. All good.

Thanks. You can close this ticket.

Best regards,

Diogo

photo
1

Hi Diogo,

Great! Thanks for letting us know. Will do.

Please don't hesitate to reach out with any other questions or concerns.

Regards,

Mike