Skip to content

Commit

Permalink
Merge pull request #259 from DSD-DBS/xpra-custom-error
Browse files Browse the repository at this point in the history
feat: Add custom error message during Xpra startup
  • Loading branch information
MoritzWeber0 authored Mar 14, 2024
2 parents dd49e57 + 8fc142b commit 8ad4d70
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions remote/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ COPY supervisord.*.conf /tmp/supervisord/

# Copy nginx configuration for xpra
COPY nginx.conf /etc/nginx/nginx.conf
COPY error.html /usr/share/nginx/html/error.html

# Allow any user to start the RDP server
# Depending on the base image used, Xwrapper.config may (not) be available and has to be created.
Expand Down
24 changes: 24 additions & 0 deletions remote/error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
~ SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
~ SPDX-License-Identifier: Apache-2.0
-->

<!doctype html>
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<h2>Xpra is not ready - 502 Bad Gateway</h2>

<div>If you started the session recently, it is not ready yet.</div>
<div>Refresh the page in a few seconds.</div>
<div>
If this error is persistent, please contact your system administrator.
</div>
</body>
</html>
4 changes: 4 additions & 0 deletions remote/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ http {
listen 10000;
server_name _;

root /usr/share/nginx/html;
error_page 502 /error.html;
error_page 404 /error.html;

if ($cookie_token !~ '__XPRA_TOKEN__') {
return 401;
}
Expand Down

0 comments on commit 8ad4d70

Please sign in to comment.