Neurohazard
暮雲煙月,皓首窮經;森羅萬象,如是我聞。

使用 docsify 快速构造文档网站

wpadmin~October 17, 2019 /System Management

使用 docsify 快速构造文档网站

安装 nodejs

[Windows]
使用 scoop 快速安装

[Linux]
使用 nvm 快速安装
或者
直接安装 Linux binary

https://www.araport.org/docs/science-apps-configuring-development-environment/installing-nodejs#method-2

docisfy 配置

npm i docsify-cli -g
docsify serve ./docs

之后再用 nginx 反向代理出来,配置文件示例如下

docsify.conf

server {
    listen 80;
    server_name docsify.blkstone.me;

    return 301 https://$host$request_uri;
}

server {
    listen       443 ssl http2;
    listen       [::]:443 ssl;
    server_name  docsify.blkstone.me;

    ssl_certificate server.crt;
    ssl_certificate_key server.key;
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_pass http://127.0.0.1:3000;

        proxy_cache_bypass $http_upgrade;
        proxy_redirect off;
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *