網際內容管理系統在精密機械教學與研究上的應用

  • Home
    • Site Map
    • reveal
    • blog
  • About
  • 主機設定
    • Windows 10
      • Win 網站簽章
      • Win Oauth2
      • Oauth2 原理
      • Nginx
    • Ubuntu設定
      • Ubuntu 簽章
      • 配置 uwsgi
      • xrdp
  • fossiloauth
    • foauth_config
  • fossilapp
  • Fossil
  • 專題報告
  • Reference
    • Flutter
      • Flutter ref
    • discourse
      • 操作管理
    • cd2020pj1
      • Oauth2
    • Network
    • Ref
      • LaTeX
      • Automatic Control
      • 參考步驟
      • ebook1
      • Project
      • Ref2
      • Bond Graphs
      • KMOLBrowser
      • Glowscript
      • Rapydscript
      • Atoms
      • Samples
      • RLearning
      • Ebooks
      • Feedback
      • CMSiMDE
      • Git
      • Windows
      • Ubuntu
      • Heorku
      • Certbot
Oauth2 原理 << Previous Next >> Ubuntu設定

Nginx

利用 http 301 設定將 http 連線導向 https 網站.

301 redirect:

server {
    listen       [::]:80 default ipv6only=on;
    server_name  pj5073.cycu.org;
    return       301 https://$server_name$request_uri;
    }

Autoindex:

利用簡單的帳號密碼, 保護 autoindex 目錄:

使用 htpasswd.exe 建立 .htpassword

而 htpasswd.exe 來自 Apache, 可以從 https://archive.apache.org/dist/httpd/binaries/win32/ 下載 .msi 後, 以 https://www.legroom.net/software/uniextract 轉出安裝後的目錄內容, 其中的 bin 目錄中包含 htpasswd.exe

htpasswd.exe 用法 htpasswd -c .htpasswd account

系統會詢問對應密碼, 然後完成 .htpasswd 檔案的建立.

Nginx 中 nginx.conf 則加入 port 88 網站的設定:

        server {
        listen       [::]:88 default ipv6only=on;
        server_name  pj5073.cycu.org;
        root C:/pj5073_data;
        auth_basic "KMOLab Login";
        auth_basic_user_file C:/pj2022/nginx-1.20.1/conf/.htpasswd;
        
        location / {
            autoindex on;
        }




Oauth2 原理 << Previous Next >> Ubuntu設定

Copyright © All rights reserved | This template is made with by Colorlib