0
$\begingroup$

I am using jupyter notebook to host my machine learning codes and notebooks.

Jupyter Notebook server is sending some HTTP headers like Server = TornadoServer/5.1.1
I want to remove this header. Also want to add some HTTP headers like Cache-Control etc.
Can someone please tell me :

  • What kind of Http server jupyter notebook runs
  • Which configuration file controls the HTTP headers sent by Jupyter notebook
  • Any link which explains how to change/add/remove the HTTP headers

Current jupyter notebook is running on Ubuntu server on https.

$\endgroup$
0
$\begingroup$

You can generate a config file in your home directory by running:

jupyter notebook --generate-config

which should leave you with a file ~/.jupyter, called jupyter_notebook_config.py.


Have a look at all the possible configurations in the Jupyter documentation.

In addition to many server options, there is specifically an options to override Tornado configuration.

NotebookApp.tornado_settings : Dict Default: {}

Supply overrides for the tornado.web.Application that the Jupyter notebook uses.

$\endgroup$
  • $\begingroup$ Thanks found it... I can add new headers.. How to change existing Server header? Should I just give some other value for this header? $\endgroup$ – Sandeep Bhutani Jun 28 '19 at 9:51
  • $\begingroup$ I am afraid I do not know. It will depend on what you want to do - if you need more detail I would suggest posting the question on StackOverflow (and include more details about what you actually want to change). $\endgroup$ – n1k31t4 Jun 28 '19 at 9:53
  • $\begingroup$ Hi, The headers set by this method are not present when user is not logged in .. by default notebook opens as /tree? which does not contain these headers $\endgroup$ – Sandeep Bhutani Jul 2 '19 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.