Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

404 when accesing through CloudFront #7148

Unanswered
okelet asked this question in Q&A
Discussion options

I have deployed code-server in an EC2 instance (private) and then created a public ALB to access it. Everything works fine. Now, I have created a CloudFront distribution, that forwards the traffic to the ALB, but I always get a 404 error when I access the homepage. /healthz works fine. Running a simple python3 -m http.server -b 0.0.0.0 8080 instead of code-server in the same instance also works fine, so I think that must be a code-server issue. Do you any any tip to continue investigating why I am getting that 404? I have also enabled trace logs, but nothing useful, although it seems that the server does something because it prints some text when I access the homepage, but getting a 404:

root@ip-10-0-0-238 http]# sudo -u coder /usr/bin/code-server --log trace
[2025年01月03日T17:16:03.569Z] debug parent:14501 spawned child process 14523
[2025年01月03日T17:16:04.020Z] debug child:14523 initiating handshake
[2025年01月03日T17:16:04.044Z] debug parent:14501 got message {"message":{"type":"handshake"}}
[2025年01月03日T17:16:04.058Z] debug child:14523 got message {"message":{"type":"handshake","args":{"bind-addr":"0.0.0.0:8080","auth":"none","config":"/home/coder/.config/code-server/config.yaml","log":"trace","user-data-dir":"/home/coder/.local/share/code-server","extensions-dir":"/home/coder/.local/share/code-server/extensions","session-socket":"/home/coder/.local/share/code-server/code-server-ipc.sock","verbose":true,"host":"0.0.0.0","port":8080,"proxy-domain":[],"_":[],"usingEnvPassword":false,"usingEnvHashedPassword":false}}}
[2025年01月03日T17:16:04.059Z] info code-server 4.96.2 08cbdfbdf11925e8a14ee03de97b942bba7e8a94
[2025年01月03日T17:16:04.059Z] info Using user-data-dir /home/coder/.local/share/code-server
[2025年01月03日T17:16:04.060Z] debug Using extensions-dir /home/coder/.local/share/code-server/extensions
[2025年01月03日T17:16:04.073Z] info Using config file /home/coder/.config/code-server/config.yaml
[2025年01月03日T17:16:04.073Z] info HTTP server listening on http://0.0.0.0:8080/
[2025年01月03日T17:16:04.074Z] info - Authentication is disabled
[2025年01月03日T17:16:04.074Z] info - Not serving HTTPS
[2025年01月03日T17:16:04.074Z] info Session server listening on /home/coder/.local/share/code-server/code-server-ipc.sock
[2025年01月03日T17:16:16.341Z] debug heartbeat
[17:16:16] Remote configuration data at /home/coder/.local/share/code-server
[17:16:16] process arguments: {
 'bind-addr': '0.0.0.0:8080',
 auth: 'none',
 config: '/home/coder/.config/code-server/config.yaml',
 log: [ 'trace' ],
 'user-data-dir': '/home/coder/.local/share/code-server',
 'extensions-dir': '/home/coder/.local/share/code-server/extensions',
 'session-socket': '/home/coder/.local/share/code-server/code-server-ipc.sock',
 verbose: true,
 host: '0.0.0.0',
 port: '8080',
 'proxy-domain': [],
 _: [],
 usingEnvPassword: false,
 usingEnvHashedPassword: false,
 help: false,
 version: false,
 'accept-server-license-terms': true,
 compatibility: '1.64',
 'without-connection-token': true,
 'builtin-extensions-dir': '/usr/lib/code-server/lib/vscode/extensions',
 logsPath: '/home/coder/.local/share/code-server/logs/20250103T171616'
}
[17:16:16]
############################################################
# I make the request here
############################################################
[17:16:16] [File Watcher (node.js)] Request to start watching: /home/coder/.local/share/code-server/Machine (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>),/home/coder/.local/share/code-server/Machine/settings.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>)
[17:16:16] [File Watcher (node.js)] Started watching: '/home/coder/.local/share/code-server/Machine'
[17:16:16] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: /home/coder/.local/share/code-server/Machine/settings.json (error: Error: ENOENT: no such file or directory, stat '/home/coder/.local/share/code-server/Machine/settings.json')
[17:16:16] [File Watcher (node.js)] starting fs.watchFile() on /home/coder/.local/share/code-server/Machine/settings.json (correlationId: undefined)
[17:16:16] ExtensionManagementService#cleanUp
[17:16:16] ExtensionManagementService#removeTempDeleteFolders
[17:16:16] Extension host agent started.
[17:16:16] [File Watcher (node.js)] Request to start watching: /home/coder/.local/share/code-server/extensions (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>)
[17:16:16] [File Watcher (node.js)] Request to stop watching: /home/coder/.local/share/code-server/Machine/settings.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>)
[17:16:16] [File Watcher (node.js)] stopping file watcher (/home/coder/.local/share/code-server/Machine/settings.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>))
[17:16:16] No uninstalled extensions found.
[17:16:16] Started scanning user extensions wr {
 scheme: 'file',
 authority: '',
 path: '/home/coder/.local/share/code-server/extensions',
 query: '',
 fragment: '',
 _formatted: 'file:///home/coder/.local/share/code-server/extensions',
 _fsPath: '/home/coder/.local/share/code-server/extensions'
}
[17:16:16] [File Watcher (node.js)] Request to start watching: /home/coder/.local/share/code-server/extensions/extensions.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>)
[17:16:16] Started scanning user extensions wr {
 scheme: 'file',
 authority: '',
 path: '/home/coder/.local/share/code-server/extensions',
 query: '',
 fragment: '',
 _formatted: 'file:///home/coder/.local/share/code-server/extensions',
 _fsPath: '/home/coder/.local/share/code-server/extensions'
}
[17:16:16] [File Watcher (node.js)] Started watching: '/home/coder/.local/share/code-server/extensions'
[17:16:16] [File Watcher (node.js)] Started watching: '/home/coder/.local/share/code-server/extensions/extensions.json'
[17:16:16] Scanned user extensions: 20
[17:16:16] ComputeTargetPlatform: linux-x64
[17:16:16] Scanned user extensions: 20
You must be logged in to vote

Replies: 1 comment

Comment options

If /healthz works then that is quite strange indeed. Just be sure, you see JSON on /healthz, with status and lastHeartbeat, right?

Are you accessing code-server at the root of the domain, or is there a sub-path like https://domain.tld/code-server?

Are there are logs in the browser console or any other information in the network panel?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /