New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix reverse proxy #57
base: master
Are you sure you want to change the base?
Conversation
Oh I think this will be badly needed! I have a few questions before commencing testing!
I really like this addition, and want to discuss something that looks like the following:
I'm excited about this and grateful for the contribution! Just a heads up I'm going to be afk for perhaps a week as I'm about to head in for a procedure. Please take your time in thinking this through, it's a simple (and powerful) change that I would like to add. |
Was a Typo: 'ContentType'.
into experiment index.html on install. Previous solution of appending the template script after the html tag was unreliable. SCRIPT_ROOT is necessary for posting to experiment factory deployed behind a reverse proxy. Experiment must POST to SCRIPT_ROOT + '/save'. ```js on_finish: function(data) { // Get the data. var data = jsPsych.data.get(); var request = $.post( SCRIPT_ROOT + '/save', {'data': data.json()}, function() { // Success, go to /next. document.location = SCRIPT_ROOT + '/next'; }, 'json') .fail(function() { // Error, local save. data.localSave('json', 'results.json'); document.location = SCRIPT_ROOT + '/next'; }); } ```
hey @jamieforth ! See if you can add the functionality without adding an entire new dependency (BeautifulSoup) which tends to be a bit heavy, and doesn't make sense to perform a tiny text parsing function. |
At my institution I can only deploy behind an Apache reverse proxy with a non-root URL.
e.g. http://example.com/my-experiment
The only way I could figure out how to deploy experiment factory in this context was to include the ReverseProxied middleware and change all
redirect()
calls to useurl_for()
in place of the absolute urls.This may or may not be generally useful. It doesn't appear to break existing root deployment, but deploying in a non-root context requires modifying nginx.gunicorn.conf as documented in flask snippet 35.