1panel 访问报错:ERR_UNSAFE_PORT,端口受限问题解决

背景

安装 1panel 的时候,安装成功,后台显示正常,但是通过浏览器就是无法访问!我使用的端口是 10080

这已经是第二次遇到这个问题了,平时不常见,上次遇到还是几年前,折腾了好久,又给忘记了!

报错信息:

网址为 xxxx 的网页可能暂时无法连接,或者它已永久性地移动到了新网址。
ERR_UNSAFE_PORT

问题原因

浏览器受限端口,这些端口在浏览器上无法访问。

下面是 chrome 浏览器的受限端口列表

1,      // tcpmux
7,      // echo
9,      // discard
11,     // systat
13,     // daytime
15,     // netstat
17,     // qotd
19,     // chargen
20,     // ftp data
21,     // ftp access
22,     // ssh
23,     // telnet
25,     // smtp
37,     // time
42,     // name
43,     // nicname
53,     // domain
69,     // tftp
77,     // priv-rjs
79,     // finger
87,     // ttylink
95,     // supdup
101,    // hostriame
102,    // iso-tsap
103,    // gppitnp
104,    // acr-nema
109,    // pop2
110,    // pop3
111,    // sunrpc
113,    // auth
115,    // sftp
117,    // uucp-path
119,    // nntp
123,    // NTP
135,    // loc-srv /epmap
137,    // netbios
139,    // netbios
143,    // imap2
161,    // snmp
179,    // BGP
389,    // ldap
427,    // SLP (Also used by Apple Filing Protocol)
465,    // smtp+ssl
512,    // print / exec
513,    // login
514,    // shell
515,    // printer
526,    // tempo
530,    // courier
531,    // chat
532,    // netnews
540,    // uucp
548,    // AFP (Apple Filing Protocol)
554,    // rtsp
556,    // remotefs
563,    // nntp+ssl
587,    // smtp (rfc6409)
601,    // syslog-conn (rfc3195)
636,    // ldap+ssl
993,    // ldap+ssl
995,    // pop3+ssl
1719,   // h323gatestat
1720,   // h323hostcall
1723,   // pptp
2049,   // nfs
3659,   // apple-sasl / PasswordServer
4045,   // lockd
5060,   // sip
5061,   // sips
6000,   // X11
6566,   // sane-port
6665,   // Alternate IRC [Apple addition]
6666,   // Alternate IRC [Apple addition]
6667,   // Standard IRC [Apple addition]
6668,   // Alternate IRC [Apple addition]
6669,   // Alternate IRC [Apple addition]
6697,   // IRC + TLS
10080,  // Amanda

解决方案

方案一:换一种端口

遇到这种情况,建议换一个非受限端口,就可以解决问题了。

如果非要头铁,非要用这个端口,考虑方案二

方案二:浏览器受限端口排除

windows

谷歌浏览器的应用图标上面,右键属性,在“模版目标”对应文本框里面,添加内容:

--explicitly-allowed-ports=10080

允许开放多个端口,端口之间使用逗号分隔。

ps:这种方式,自己可以访问,别人依然无法访问。

mac

过于复杂,建议改端口。。

  1. 进入 Chrome.app目录

  2. 将原本的脚本改个名字,后面还要使用该脚本启动

    sudo mv "Google Chrome" Chrome.back
    
  3. 新建一个脚本。Google Chrome

    #!/bin/bash
    /Applications/Google Chrome.app/Contents/MacOS/Chrome.back" --explicitly-allowed-ports=10080 "$@"
    
  4. 将脚本赋权。

    sudo chmod u+x "Google Chrome"
    

你可能感兴趣的:(问题记录,服务器,教程,服务器,centos,运维)