tft每日頭條

 > 科技

 > nginx 設置訪問密碼

nginx 設置訪問密碼

科技 更新时间:2024-09-30 15:23:14

修改 nginx.conf 文件實現。

1server {

2 listen 80;

3 server_name localhost;

4

5 ……

6}

改成

01server {

02 listen 81;

03 server_name localhost;

04

05 location / {

06 root html;

07 index index.html index.htm;

08 }

09 ……

10}

當然改成 8080,8081 什麼的都可以,不一定要 81,但是确保 iptable 要放開對該端口的訪問。

注意到 location 的配置:

  • root html; #根目錄,相對于安裝目錄
  • index index.html index.htm; #默認主頁

默認,你把文件放在安裝目錄下的 html 文件夾,

nginx 設置訪問密碼(如何修改Nginx的默認端口)1

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关科技资讯推荐

热门科技资讯推荐

网友关注

Copyright 2023-2024 - www.tftnews.com All Rights Reserved