Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行sandbox是否可以用nginx替换Caddy #84

Closed
arcelan opened this issue Jan 4, 2024 · 3 comments
Closed

运行sandbox是否可以用nginx替换Caddy #84

arcelan opened this issue Jan 4, 2024 · 3 comments

Comments

@arcelan
Copy link

arcelan commented Jan 4, 2024

目前看到以下命令会构建出www的静态资源

yarn install
yarn build:deps
yarn build:sandpack

Caddy依赖的配置是以下几项

  1. https的设置
  2. local.netease.com的域名设置
  3. Origin-Agent-Cluster ?0 的 header设置

请问如果替换成nginx的话,是否只要满足以上3点就可以了?
是否还依赖Caddy的其他特性?

@ccloli
Copy link
Contributor

ccloli commented Jan 4, 2024

请问如果替换成nginx的话,是否只要满足以上3点就可以了?

可以的,只需要配置好 https 和 rootadd_header 即可

@arcelan
Copy link
Author

arcelan commented Jan 4, 2024

请问如果替换成nginx的话,是否只要满足以上3点就可以了?

可以的,只需要配置好 https 和 rootadd_header 即可

感谢!

@ccloli ccloli closed this as completed Jan 4, 2024
@arcelan
Copy link
Author

arcelan commented Jan 5, 2024

附上nginx配置

  server {
    listen       443 ssl;
    server_name  local.netease.com;
    ssl_certificate  /etc/nginx/ssl/local.netease.com.pem;
    ssl_certificate_key  /etc/nginx/ssl/local.netease.com-key.pem;
    root  /usr/share/nginx/html/;
    add_header Origin-Agent-Cluster "?0";
  }

/usr/share/nginx/html/ 对应 https://github.com/NetEase/codesandbox-client.git build出来的静态文件
证书文件可以从 https://github.com/NetEase/tango/tree/main/apps/playground 找到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants