Skip to content

CORS error in jupyterhub #56

Description

@Roussman

Hello,

I'm trying to install jupydrive-s3 on our JupyterHub server. I'm having issues with CORS: my file explorer has stopped working and isn't displaying anything.

My browser's console displays the following message:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://example.com/s3/jupyter-drives-test-bucket-1/?list-type=2&prefix=. (Reason: CORS header \u2018Access-Control-Allow-Origin\u2019 missing). Status code: 405.

I’ve tried several configurations to modify this origin policy, but none of them work:

In jupyter.conf :

server: {
   listen 443 ssl http2 ;
  [...]
   add_header 'Access-Control-Allow-Origin' '*'; 
  [...]
   location / {
  [...]
       proxy_set_header Host $http_host;
       proxy_set_header 'Access-Control-Allow-Origin' '*';
  [...]
}

In nginx.conf

    server {
        listen       80;
[...]
        proxy_set_header Host $http_host;
        add_header 'Access-Control-Allow-Origin' '*';
    }

In jupyterhub_config

origin = '*'
c.JupyterHub.tornado_settings = {
'headers': {
'Access-Control-Allow-Origin': origin,
},
}

In spawner_config

c.Spawner.args = ['--ContentsManager.allow_hidden=True',
    '--VoilaConfiguration.enable_nbextensions=True',
    "--VoilaConfiguration.file_whitelist=['.*']",
    '--ServerApp.allow_origin=*']

Nothing works. What configuration can I use to get Jupydrive-s3 to work in my JupyterHub environment?

Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions