Reverse Proxy

(a id=“nxw_TAB_MANAGE” accesskey=“m” onclick=“if(!(event.ctrlKey||event.metaKey||event.button==1)) {this.href='http:\/\/127.0.0.1:8080\/nuxeo\/nxpath\/default@view_domains?tabIds=%3ATAB_MANAGE&conversationId=0NXMAIN2'}“href=“http://website.com/nuxeo/nxpath/default@view_domains?tabIds=%3ATAB_MANAGE” name=“nxw_TAB_MANAGE”> (span class=“actionLabel “>Manage(/span></a)

This is when you get the properties, of say Home, Document Management, etc.

I've got the proxy to the point it's somewhat working. The only issue (quite large unfortunately) is that I can't figure out how to get the this.href to rewrite over to the website.com that is referenced in the regular href. If I click ctrl and the link, it goes to the normal href, but when clicking the link normally, it'll just go to the 127.0.0.1 local address. I am doing this through IIS as the webserver, I think I just need to add a custom tag, but have been unable to figure out what tag needs to be added. Any help would be appreciated.

0 votes

2 answers

3692 views

ANSWER

After searching some more, I've found the function getBaseURL() is returning http://127.0.0.1:8080/nuxeo/ as the baseURL, so I guess the question now is, where is it calling this from?

In nuxeo.conf my nuxeo.url=http://websitename.org/nuxeo, so not sure where this call is going. Could this info be cached somewhere?

03/18/2014

Have you followed the reverse proxy doc? What did you configure exactly?
03/18/2014

Yes, specifically the IIS version that's linked on the page: http://doc.nuxeo.com/display/public/ADMINDOC58/Internet+Information+Services+%28IIS%29+Configuration

ARR installed, proxy enabled, rewrite module installed

Inbound rules, per the link working correctly, redirects traffic.

But the outbound rule (not referenced in the document) is only hitting the normal href, not hitting the this.href made by the java call. In older versions there was just the href, but the newer ones have a java check that makes a call of baseurl and I'm not sure where it's getting the baseurl info.

On the demo.nuxeo.com site, their this.href references the http://demo.nuxeo.com/nuxeo.

My application url = http://website.org/nuxeo I've looked in server.xml and base url isn't referenced. This call is made:

var baseURL='http://127.0.0.1:8080/nuxeo/'; function getBaseURL() { return baseURL; }

Then tiny_mce.js breaks that into the http:&#92;/&#92;/127.0.0.1:8080&#92;/nuxeo&#92;/nxpath&#92;/default,etc

03/18/2014

New finding. the this.href is my inbound rewrite url… I set the inbound just as the server ip and that now shows…

The documentation doesn't state, that I can find, but are there additional parameters I need to set in nuxeo, as far as I can tell from the apache documentation the changes are needed in apache(in my case IIS) as opposed to nuxeo.

03/18/2014



Incase anyone else tries to do an IIS reroute, the documentation is correct, but 1 additional thing needs to be done. Retain Host Headers, apparently not enabled by default, you have to manually enable, then everything works.

cmd: appcmd.exe set config -section:system.webServer/proxy -preserveHostHeader:true

1 votes



Thanks I'll add this to the doc. Could you tell me if there's a user interface for this, to add it below the other configuration steps in the doc?
03/19/2014

Not within IIS(8.5) that I could find, just the command in the command prompt window.

Now I'm working on ssl…

03/19/2014


All that's needed for virtual hosting is the setting of an HTTP header Nuxeo-Virtual-Host to something like http://mysite.com. This is done differently for different reverse proxy solutions, for IIS it seems to be the HTTP_NUXEO_VIRTUAL_HOST server variable (see doc). For Apache it's RequestHeader append nuxeo-virtual-host (see doc).

In addition, for things that need the URL but are not triggered through HTTP requests (think for instance of asynchronous sending of emails), the property nuxeo.url must be set in nuxeo.conf.

0 votes



This is how my inbound rule is configured per the document.

As far as I can tell the nuxeo.url in config is the same as the Application URL in the gui. (5.9.2) Between Begin and End. There is a nuxeo.url up top, but it's commented out and I figure if it's uncommented then the same variable names will conflict?

With everything in this exact configuration with no outbound rewrite rule, href and this.href point to the internal ip and don't point to the outward facing proxy.

I've even tried the proxy http in the gui and can't find that it does anything.

03/18/2014