方法:修改uhttpd文件

文件位置

/etc/config/uhttpd

文件内容

config uhttpd 'main'
    list listen_http '0.0.0.0:80'
    list listen_http '[::]:80'
    list listen_proxy '127.0.0.1:8000'
    list listen_https '0.0.0.0:443'
    list listen_https '[::]:443'
    option home '/www'
    option rfc1918_filter '0'
    option max_requests '3'
    option max_connections '100'
    option cert '/etc/config/uhttpd.crt'
    option key '/etc/config/uhttpd.key'
    option cgi_prefix '/cgi-bin'
    list lua_prefix '/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua'
    option script_timeout '60'
    option network_timeout '30'
    option http_keepalive '20'
    option tcp_keepalive '1'
    list index_page 'cgi-bin/luci'
    option ubus_prefix '/ubus'

config cert 'defaults'
    option days '730'
    option bits '2048'
    option country 'ZZ'
    option state 'Somewhere'
    option location 'Unknown'
    option commonname 'Openwrt Koolshare mod'

修改端口

使用vi编辑

    list listen_http '0.0.0.0:80'       #ipv4http端口80
    list listen_http '[::]:80'          #ipv6http端口80
    list listen_proxy '127.0.0.1:8000'  #代理端口8000
    list listen_https '0.0.0.0:443'     #ipv4https端口443
    list listen_https '[::]:443'        #ipv6https端口443

以上几个按需修改

开启HTTPS

首先上传域名证书,比如上传上/etc/config/目录
编辑此处指向证书

    option cert '/etc/config/uhttpd.crt'
    option key '/etc/config/uhttpd.key'

最后

重启uhttpd服务

/etc/init.d/uhttpd restart

其他

如不成功请在软件包内检查是否已安装openssl