nginx-hosting
Primary deployment method for all games.
Serves static files directly from the host nginx at:
INLINECODE0
How It Works
nginx is already running on this host with a valid SSL cert for roger-us02.clawln.net.
The /games/ location block is configured to serve files from /data/games/.
Deploying a game = copying files + reloading nginx. No external service needed.
nginx config (already applied)
Location block in /etc/nginx/conf.d/roger-us02.clawln.net.conf:
CODEBLOCK0
Deploy a game
CODEBLOCK1
Update an existing game
Same as deploy — just overwrite the files and reload:
CODEBLOCK2
List deployed games
CODEBLOCK3
Base URL
CODEBLOCK4
Each game lives at https://roger-us02.clawln.net/games/{game-name}/.
Constraints
- - Static files only (HTML, JS, CSS, images, audio)
- No server-side logic or databases
- All games share the same domain and SSL cert
- nginx binary: INLINECODE6
- Games root: INLINECODE7
nginx-hosting
所有游戏的主要部署方式。
直接从主机 nginx 提供静态文件,地址为:
https://roger-us02.clawln.net/games/{游戏名称}/
工作原理
nginx 已在此主机上运行,并持有 roger-us02.clawln.net 的有效 SSL 证书。
/games/ 位置块已配置为从 /data/games/ 提供文件。
部署游戏 = 复制文件 + 重新加载 nginx。无需外部服务。
nginx 配置(已应用)
位于 /etc/nginx/conf.d/roger-us02.clawln.net.conf 的位置块:
nginx
location /games/ {
alias /data/games/;
index index.html;
try_files $uri $uri/ $uri/index.html =404;
}
部署游戏
bash
1. 复制构建文件
mkdir -p /data/games/{游戏名称}
cp -r /path/to/build/* /data/games/{游戏名称}/
2. 重新加载 nginx(无停机)
/usr/sbin/nginx -s reload
3. 验证
curl -sk https://roger-us02.clawln.net/games/{游戏名称}/ | head -3
更新已有游戏
与部署相同——只需覆盖文件并重新加载:
bash
cp -r /path/to/new-build/* /data/games/{游戏名称}/
/usr/sbin/nginx -s reload
列出已部署的游戏
bash
ls /data/games/
基础 URL
https://roger-us02.clawln.net/games/
每个游戏位于 https://roger-us02.clawln.net/games/{游戏名称}/。
限制条件
- - 仅限静态文件(HTML、JS、CSS、图片、音频)
- 无服务器端逻辑或数据库
- 所有游戏共享同一域名和 SSL 证书
- nginx 二进制文件:/usr/sbin/nginx
- 游戏根目录:/data/games/