<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之旅 廣告
                ### 安全規則設置端口 > 云服務控制中,選擇“安全規則”設置入網規則,設置端口為子域名的端口,別使用平常使用的端口,如圖: ### 先啟動服務 > 先將二級域名服務器開啟,端口設置為安全規則一致即可,比如開啟的 3000端口,可以通過域名直接訪問到,http://xxx.com:3000 ### 配置nginx > 在 nginx 安裝目錄下的conf目錄下的 nginx.conf 。進行打開 ``` cd nginx/conf ``` > 進行編輯 ``` vi nginx.conf ``` #### 使用情況一: > 將當前nginx網站替換成其他的網站,內容如下: ``` #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; # .....省略 server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { # ----------------修改此出---------- #root html; # index index.html index.htm; proxy_pass http://localhost:3000; # 添加上 } # 省略 } ``` #### 第二種情況 > 只是弄二級域名。新增的內容如下(注意:新增的必須在第一個server后面新增,不然就是跑第一個當主網站了): ``` #user nobody; worker_processes 1; # .. 省略代碼 http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; # proxy_pass http://localhost:3000; } # .. 省略代碼 } # ------------------ 找到上面server結束的 } 括號,在下面進行新增 ------- server { listen 80; # 端口 server_name api.xxx.cn; # 域名 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; } } # .. 省略代碼 } ``` ### 重新啟動 nginx > 記住是重啟,不是啟動 ``` /usr/local/nginx/sbin/nginx -s reload ``` ### 就可以訪問了 ### 源代碼 > 有些注釋去掉了后,一看就明白了,只要在server 后面新增一個就可以了,然后再改改參數 ``` #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; 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; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } # 只能在第一個 server 后面新增,不能放在前面 server { listen 80; # 端口 server_name api.xxx.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; } } } ```
                  <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>

                              哎呀哎呀视频在线观看