Jump to:

4945 Posts in 17688 Topics by 1494 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Reverse Proxy Ajax issues

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 3489 Views
  • Shawn Parr
    Avatar
    Community Member
    60 Posts

    Reverse Proxy Ajax issues Link to this post

    I'm working on setting up some SilverStripe installs on a system that is behind a reverse proxy, using Apache2's proxy modules, and mod_proxy_html. For the most part SilverStripe works just fine, except for a few places in the admin pages.

    Specifically there are the following issues:
    1. Creating a new page gives an Ajax error. Clicking on one of the other admin sections and coming back shows that the page was actually created.
    2. Deleting a page gives an Ajax error. As above going to another section and returning shows that the page was actually deleted.
    3. Unable to add new users using the auth_external module. All our users will be from AD.

    If I hit the backend server directly none of these issues exist. So it is happening during the proxy process. Since any Ajax errors that show a path are displaying the path of the backend server that leads me to suspect that a .js file is being generated or passed with a variable that has the hostname in an absolute path rather than relative. I'm digging around to find out if I can find where this might happen, but I thought I would drop a note here to see if anyone has ran across this before and found a solution, or if someone might have pointers where to start digging.

    I should also mention that other functions are fine, like putting content on pages, changing their type, making forms, drag and drop editing of forms and the site tree view.

    The specific errors are as follows:

    1. Create a page:
    Error in Ajax evaluator on line undefined: Parse error
    var tree = $('sitetree'); var newNode = tree.createTreeNode("18", "New Page", "Page"); node = tree.getTreeNodeByIdx(0); if(!node){   node = tree.getTreeNodeByIdx(0); } node.open(); node.appendTreeNode(newNode); newNode.selectTreeNode();

    2. Delete a page:
    Error in Ajax evaluator on line undefined: Parse error
    $('Form_EditForm').loadActionsFromString(''); $('Form_EditForm').loadActionsFromString(''); $('Form_EditForm').updateStatus('New page'); $('sitetree').setNodeTitle(18, 'New Page') $('Form_EditForm').elements.StageURLSegment.value = 'http://<backend server path>/new-page/' $('Form_EditForm').elements.LiveURLSegment.value = '' $('Form_EditForm').notify('PagePublished', $('Form_EditForm').elements.ID.value); statusMessage('Removed \'New Page\' from the draft site', 'good');

    Thanks for any help.

  • cpxksr
    Avatar
    Community Member
    5 Posts

    Re: Reverse Proxy Ajax issues Link to this post

    I'm having the same issues, the biggest one for me is that the Security page doesn't work. ie. when I click the Security Group, I don't get the table with the users. Just a small "loading..." ajax in the bottom left corner, and then a gray div.

    I'm running SS behind a dumb nginx proxy, doesn't do any caching or anything.

    Everything else seems to be working just fine, the editor, uploads etc...

  • Shawn Parr
    Avatar
    Community Member
    60 Posts

    Re: Reverse Proxy Ajax issues Link to this post

    Unfortunately I never found a real solution to this problem. What I did was completely reconfigure how we were doing our reverse proxy.

    Instead of having multiple sites in sub directories, we moved them all to their own dns addresses. So instead of example.com/site1 we changed to site1.example.com.

    We then pass the hostname variable from the front end proxy to the upstream server. So both the proxy and the upstream have a virtual host for site1.example.com. This allows us not to have to use proxy_html at all, and made the setup much cleaner, except for duplicate apache conf files. I script that part of setup anyway, so it wasn't much skin off my back.

    Once setup in this way the errors never occur, and it all works as intended. Of course this type of setup probably won't be useful to most people looking for an answer to this, but it did work for us. So we went with it.

    3489 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.