<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### 前言 > 設置這個是比較好用的。代理的話,最好是以跑 https 做測試。如果想弄個免費的證書的話,點擊我 ### 證書上傳 > 上傳直接可以通過 finalShell 工具,證書放在:/etc/ssl/certs/證書名.pem; ### 配置http重定向https > 進入到 ``` cd /usr/local/nginx/conf/ ``` > 編輯 ``` vi nginx.conf ``` > 找到 server 是 80的。加上重定向到https上面 ``` # 省略代碼塊 server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; rewrite ^(.*)$ https://$host$1 permanent; #用于將http頁面重定向到https頁面 location / { root html; index index.html index.htm; } # 省略代碼塊 ``` > 加上了后,在找到注釋的:#?HTTPS?server 。將下面的一段話http的注釋打開,然后更改ssl地址 ``` # 省略代碼塊 。找到 HTTPS server注釋,下面全部打開 # HTTPS server server { listen 443 ssl; server_name localhost; ssl_certificate /etc/ssl/certs/4489861_www.lolku.cn.pem; ssl_certificate_key /etc/ssl/certs/4489861_www.lolku.cn.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root html; index index.html index.htm; } } ``` ### 重新啟動配置 > 重啟后,就可以在頁面上跑了。 ``` /usr/local/nginx/sbin/nginx -s reload ``` ### 二級域名https代理 > 前面只是講解當前一級域名https的請求。根據http二級域名經驗,進行制作二級https二級域名。都是一樣的,只要后面新增一個新的,然后再代理上新的就好了(注意:一定是在第一個server的后面新增server)。比如: ``` worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; rewrite ^(.*)$ https://$host$1 permanent; #用于將http頁面重定向到https頁面 location / { root html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } # 只能在后面新增,不能放在前面 server { listen 80; # 端口 server_name api.xxxx.cn; # 域名 rewrite ^(.*)$ https://$host$1 permanent; #用于將http頁面重定向到https頁面 location / { proxy_pass http://localhost:3000; # 代理的地方 proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } # # HTTPS server # # server { listen 443 ssl; server_name localhost; ssl_certificate /etc/ssl/certs/xxxxx.pem; ssl_certificate_key /etc/ssl/certs/xxxxx.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root html; index index.html index.htm; } } # 只能在后面新增,不能放在前面 server { listen 443 ssl; server_name api.xxx.cn; ssl_certificate /etc/ssl/certs/xxxxxx.pem; ssl_certificate_key /etc/ssl/certs/xxxxxx.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { proxy_pass http://localhost:3000; # 代理的地方 proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } } ``` ### 訪問 > 訪問 http://xxx.cn 是可以的,然后api.xxx.cn 會報危險警告,原因在于代理的 proxy_pass http://localhost:3000; 這個地址是 http 不是https,所以有問題。解決方案:http://locakhost:3000 換成 https://locakhost:3000 或者改成 https://xxx.cn:3000 ### 重啟下配置 > 注意:每次更改下配置都得重新啟動下 ``` /usr/local/nginx/sbin/nginx -s reload ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看