docker run --name=cocalc -d -v ~/cocalc:/projects -p 9090:443 sagemathinc/cocalc
In your nginx sites-available folder, create a file like the following called e.g. mycocalc:
server {
server_name mycocalc.com;
location / {
include proxy_params;
# push traffic through the proxy to the port you mapped above, in this case 9090, on the localhost:
proxy_pass https://localhost:9090/;
# this enables proxying for websockets, which cocalc uses extensively:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
listen 443 ssl;
}