Repository navigation
White Screen Shown After Login. (Docker, Nginx, Cloudflare) #4164
Copy link
Copy link
Closed
Labels
waiting-for-infoWaiting for more information from submitterWaiting for more information from submitter
Description
OS/Web Information
- Web Browser: Firefox 92.0
- Local OS: Windows
- Remote OS: codercom/code-server:latest
Steps to Reproduce
-
Host code-server on docker:
docker run --name code-server -dp 8080:8080 -v "$HOME/.config:/home/coder/.config" -v "$PWD/work:/home/coder/" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" -e PASSWORD="password" -e PROXY_DOMAIN=subdomain.domain.tld --network=web -
Proxy with nginx:
listen 80;
server_name subdomain.domain.tld;
location / {
proxy_pass http://172.21.0.1:8080/; (172.21.0.1 is the docker network localhost)
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
}
- Add Cloudflare
I added the subdomain to my Cloudflare. When accessing the site, the login page works (with https) but after logging in it shows a white screen. WebSocket Support IS ENABLED
Expected
Code server opens up to home screen.
Actual
White screen is displayed
Logs
[2021-09-15T02:18:02.718Z] info Wrote default config file to ~/.config/code-server/config.yaml
[2021-09-15T02:18:03.519Z] info code-server 3.11.1 acb5de66b71a3f8f1cc065df4633ecd3f9788d46
[2021-09-15T02:18:03.521Z] info Using user-data-dir ~/.local/share/code-server
[2021-09-15T02:18:03.552Z] info Using config file ~/.config/code-server/config.yaml
[2021-09-15T02:18:03.552Z] info HTTP server listening on http://0.0.0.0:8080
[2021-09-15T02:18:03.552Z] info - Authentication is enabled
[2021-09-15T02:18:03.552Z] info - Using password from $PASSWORD
[2021-09-15T02:18:03.552Z] info - Not serving HTTPS
Video
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
waiting-for-infoWaiting for more information from submitterWaiting for more information from submitter

Activity
jsjoeio commentedon Sep 15, 2021
Can you look at the console in the browser and share any logs you see there?
porterporter commentedon Sep 15, 2021
Done. https://starb.in/LHhSUF.js
It's definitely the websocket but is enabled on cloudflare.
jsjoeio commentedon Sep 15, 2021
Awesome! So a couple things 🤔
You could try clearing your cache + localStorage to see if this goes away.
I feel like we see this from time to time when websockets fail for some reason (usually an environment issue).
Hmm... To confirm this, can you disable websockets in Cloudflare and see what happens?
porterporter commentedon Sep 16, 2021
For the issue with the background. I cleared cache & local storage. Issue till persists.
After disabling websockets in Cloudflare, issue also still persists. Console: https://starb.in/LkGjSI.js
For the time being, i've turned websockets back on in Cloudflare as I try to troubleshoot this.
Also, thank you so much for your help
jsjoeio commentedon Sep 16, 2021
Thanks for the logs!
Does that mean you can get back the white screen? But also, this should always be on though, no?
In case it helps, this is where the error happens. It's looking for an item called
colorThemeDatain your localStorage and not finding it 🤔porterporter commentedon Sep 17, 2021
Fixed! I think cloudflare was acting up and it took a bit to propagate but it's working now for me. For anyone who might need it:
Here are the nginx settings required for running it:
Also don't forget to use --proxy-domain in your launch arguments
Ed1ks commentedon Oct 17, 2023
I have a blank screen on my pc, too.:

Running code-server in Docker with nginx-proxy-manager.
On my mobile phone there is everything fine, and I can view the page normaly.
Any help appreciated!
code-asher commentedon Oct 17, 2023
Can you try an incognito window and a hard refresh? Might also make sense to try different browsers. Basically just want to rule out cache issues.
It could be because of the hash mismatch although I am not able to reproduce it.
Ed1ks commentedon Oct 19, 2023
Incognito and a different browser does not help. Probably it is because of a company certificate on the client side.
code-asher commentedon Oct 19, 2023
Yeah you might be right, could be the hash mismatch is a red herring. An idea is to make your browser ignore content security policy just to be sure.
Ed1ks commentedon Oct 20, 2023
@code-asher
This eliminates the first red error. But still blank page.
code-asher commentedon Nov 16, 2023
Sorry for the long delay, I was out a few weeks.
Thanks for experimenting with the content security policy. It occurred to me that if it was a certificate issue we would probably see warnings or errors in the browser about it, I think? Since we are not seeing them maybe it is something else. I have seen similar problems with misconfigured reverse proxies so maybe that could be it? I have not used
nginx-proxy-managerbefore but just in case maybe this helps: NginxProxyManager/nginx-proxy-manager#723code-asher commentedon Nov 16, 2023
Ah wait but you mentioned it works from a different device, your phone, so it seems the proxy is correctly configured. That puts me at a loss. If you are able to reproduce with a Docker compose example or something I could try running it and see if I get the same.
docs: note that Cloudflare Rocket Loader must be disabled
docs: note that Cloudflare Rocket Loader must be disabled