I am having some questions about the configuration of Jupyter notebook, regarding allowing/denying access from LAN.
Firstly, in the case where the file jupyter_notebook_config.py
exists, according to the documentation, there is an option called NotebookApp.allow_remote_access
(boolean value), and the documentation says that this means: "Allow requests where the Host header doesn’t point to a local server". From my understanding, the host header contains the domain the client want to access (see What is HTTP "Host" header?). But why can we know, by looking at the the domain name the client is sending, whether or not the client is on local network? If we set the host header to localhost
when we send request on a different machine, then will jupyter notebook do something to verify that this localhost
is not real? Plus, we could access jupyter notebook just by typing the ip address and port (127.0.0.1:8888), without specifying any domain name. So does "host header" mean something different here?
Consider secondly the case where the file jupyter_notebook_config.py
has not been created. In this case, when I run the command jupiter notebook
, will the notebook server be accessible to some other computer on local area network(LAN)?
I am trying to configure jupyter notebook (version 6.4.12), so that the jupyter server can be accessed only on the computer where we run the server. The aim is to prevent any other device from accessing the jupyter notebook server (and files in current working directory of the server). Does the default behaviour of jupyter notebook (i.e. running only the command jupiter notebook
without flags and editing the configuration files) already satisfy what I am trying to achieve?