不到十行代码: package main import ( "log" "net/http" ) func main() { http.Handle("/", http.FileServer(http.Dir("youpath"))) log.Fatal(http.ListenAndServe(":8080", nil)) } 可能需要注意是否可以回溯。 如果可以访问到父目录就会有安全问题。 参考 挖洞技巧:如何绕过URL限制 分享几个绕过URL跳转限制的思路 URL跳转绕过姿势