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

【開発:プラットフォーム編】LINE Botを動かすためのSSL関連の設定 #33

Open
urashin opened this issue Feb 15, 2022 · 4 comments
Assignees

Comments

@urashin
Copy link
Owner

urashin commented Feb 15, 2022

  • 手動での構築手順をマニュアル化する
  • 可能な部分(できれば全体)の構築を自動化する
@urashin
Copy link
Owner Author

urashin commented Feb 17, 2022

LINE BOTを動かすまでに必要な手順(Johnさんのメモから)

  • nginxのinstallが必要
  • SSLの設定が必要 (certbot)
  • nginxの設定が必要 (スレッド参照)
  • python 起動
  • LINE Developers でURL設定

@urashin
Copy link
Owner Author

urashin commented Feb 17, 2022

vim /etc/nginx/nginx.conf

....
    server {
        listen       443 ssl http2;
        listen       [::]:443 ssl http2;
        server_name  ___your_domain___;
        root         /usr/share/nginx/html;
        ssl_certificate     "/etc/letsencrypt/live/___your_domain___/fullchain.pem";
        ssl_certificate_key "/etc/letsencrypt/live/___your_domain___/privkey.pem";
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
        location /messaging {
            proxy_pass http://localhost:8000;
        }
        
        error_page 404 /404.html;
            location = /40x.html {
        }
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
    
....

@urashin
Copy link
Owner Author

urashin commented Mar 2, 2022

@1n-mas 現在、LINE Messaging APIとの連携部分は繋がっていないことが原因でエラーが返るまで相当時間がかかるので、python APIを呼ぶ箇所をコメントアウトしています。動作確認の際は該当箇所を修正しますのでお声がけください。

@1n-mas
Copy link
Collaborator

1n-mas commented Apr 10, 2022

【完了】
nginxのinstallが必要
SSLの設定が必要 (certbot)
nginxの設定が必要 (スレッド参照)

nginxの構成ファイルは下記の通り修正を加えて実施。
・PROXY先はDockerネットワークIPへ変更
・Lets Encryptのチャレンジ(DNS検証)に対応。
・エラーページのリダイレクトなし。

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