Giter Site home page Giter Site logo

Comments (6)

Joseph-Singleton avatar Joseph-Singleton commented on May 24, 2024

@exception0x876 - Thanks for posting this. It fixes the error being thrown running tngrok.

I have found however that, if caching is enabled, JS will load under the local host instead of the ngrok host.

Did you run into this?

from totara-docker-dev.

exception0x876 avatar exception0x876 commented on May 24, 2024

@exception0x876 - Thanks for posting this. It fixes the error being thrown running tngrok.

I have found however that, if caching is enabled, JS will load under the local host instead of the ngrok host.

Did you run into this?

I haven't tried it with caching enabled. Would you mind posting the relevant cache settings from your config.php?

from totara-docker-dev.

scq avatar scq commented on May 24, 2024

I had to also set a few other config options in config.php to make everything work properly and have the generated URLs etc be correct:

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
    // ngrok 3.x
    $CFG->wwwroot = $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://' . $_SERVER['HTTP_X_FORWARDED_HOST'];
    $CFG->reverseproxy = true;
    if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
        $CFG->sslproxy = true;
    }
}

(was a quick fix, so I just added this block after the existing checks)

Will make a PR to add something like this to the default config.php.

from totara-docker-dev.

derschatta avatar derschatta commented on May 24, 2024

With the workaround explained in the description

"Update config.php and change $_SERVER['HTTP_X_ORIGINAL_HOST'] to $_SERVER['HTTP_X_FORWARDED_HOST']"

it worked for me. Created a PR.

@scq did the workaround not work out of the box for you? What happens without the changes you mention?

from totara-docker-dev.

scq avatar scq commented on May 24, 2024

@derschatta Ah, I wasn't using tngrok and was passing some different configuration flags. With the same flags as tngrok, that change does work for me.

from totara-docker-dev.

derschatta avatar derschatta commented on May 24, 2024

fixed in #225

from totara-docker-dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.