K7

K7Blog

须知少年凌云志 曾许人间第一流.
proton
telegram

siteproxy 反向代理任意ウェブサイト

プロジェクトのアドレス:https://github.com/netptop/siteproxy

VPS サーバーにデプロイする#

  1. SSL ウェブサイトを作成します(certbot と nginx を使用し、Google で使用法を検索してください)。nginx を設定し、
    /etc/nginx/sites-enabled/default に以下の内容を含める必要があります:

    ...
    server {
       server_name siteproxy.your.domain.name
       location / {
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto $scheme;
         proxy_pass       http://127.0.0.1:8011;
       }
    }
    
  2. 実行:sudo systecmctl start nginx

  3. ユーザー環境で以下のコマンドを実行して、Node 環境をインストールします。既に Node 環境を持っている場合は、このステップを無視してください。

    (1)curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
    (2)source ~/.bashrc
    (3)nvm install v12.16.3
    
  4. 実行:npm install -g forever

  5. 実行:git clone https://github.com/netptop/siteproxy.git;

  6. 実行:cd siteproxy; npm install;

  7. config.js ファイルを開き、serverName が定義されている場所を見つけて、次のように変更します:

    serverName: 'siteproxy.herokuapp.com' ====> 'ここにあなたのドメインを入力'
    
  8. 実行:forever start -c 'node --tls-min-v1.0' index.js

  9. これでブラウザでドメインにアクセスできるようになりました。

  10. CloudFlare を使用して加速したい場合は、CloudFlare の説明を参照してください。

読み込み中...
文章は、創作者によって署名され、ブロックチェーンに安全に保存されています。