How do I configure the property "c.NotebookApp.allow_origin" for Jupyter?

In HOPSWORKS, Jupyter is launched based on a Docker image. If I want to modify the property “c.NotebookApp.allow_origin” in the Jupyter configuration file (, how should I do? I want to configure it like this:

c.NotebookApp.allow_origin = ‘*’

I read the source code and found the following code in :

String allowOriginHost = uriInfo.getBaseUri().getHost();
int allowOriginPort = uriInfo.getBaseUri().getPort();
String allowOriginPortStr = allowOriginPort != -1 ? “:” + allowOriginPort : “”;
String allowOrigin = settings.getJupyterOriginScheme() + “://” + allowOriginHost + allowOriginPortStr;

Does it mean I only have two choices?
(1) Modify the source code and recompile;
(2) Generates a new Docker image;

Any comments will be much appreciated. BTW, I think that these common configuration items should be set as system variables.

The template for the jupyter notebook is located in /srv/hops/domains/domain1/templates/ - If you want to change the “allow_origin” for all the jupyter notebooks on your cluster, you can change it there and restart glassfish-domain1 service.

@Fabio ,
Ok, thank you very much for your reply.