1

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.

Sandeep Bhutani
  • 894
  • 1
  • 7
  • 24

1 Answers1

2

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.

n1k31t4
  • 14,858
  • 2
  • 30
  • 49
  • Thanks found it... I can add new headers.. How to change existing Server header? Should I just give some other value for this header? – Sandeep Bhutani Jun 28 '19 at 09:51
  • 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). – n1k31t4 Jun 28 '19 at 09:53
  • 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 – Sandeep Bhutani Jul 02 '19 at 11:27