Skip to content

Instantly share code, notes, and snippets.

@clarencetw
Last active July 27, 2019 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarencetw/fbbea667a20d6171f13f7a30f1c638fb to your computer and use it in GitHub Desktop.
Save clarencetw/fbbea667a20d6171f13f7a30f1c638fb to your computer and use it in GitHub Desktop.
carbon-iframe-appears-carbon-now-sh-rejects-connection-cause-analysis-and-carbon-erection-teaching
git clone https://github.com/dawnlabs/carbon
cd carbon
npm install /* install 安裝 */
npm run build /* build 編譯 */
npm start /* start 開啟服務 */
upstream carbon-backend {
server 127.0.0.1:8080;
keepalive 64;
}
server {
server_name carbon.clarence.tw;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://carbon-backend;
proxy_http_version 1.1;
proxy_pass_request_headers on;
proxy_set_header Connection "keep-alive";
proxy_store off;
}
rewrite ^/embed(.*) /embed;
rewrite ^/service-worker.js$ /_next/static/service-worker.js;
location /_next/static/service-worker.js {
add_header 'Service-Worker-Allowed' '/';
}
location ^/static/(.*) {
root /static/;
}
add_header X-Frame-Options "ALLOW-FROM blog.clarence.tw";
add_header Content-Security-Policy "frame-ancestors blog.clarence.tw";
}
{
"name": "carbon",
"version": "3.9.35",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start -p 8080",
"export": "next export",
"test": "jest",
"test:e2e": "npm run cy:run --",
"deploy": "now",
"prettier": "prettier --config .prettierrc --write {.,components,lib,pages}/*.js {components,lib,pages,packages}/**/*.js",
"lint": "eslint .",
"contrib:add": "all-contributors add",
"contrib:build": "all-contributors generate",
"cy:run": "cypress run",
"cy:open": "cypress open"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment