云服务器防火墙开放端口
TCP 778和TCP 6000
nginx和frp冲突解决
顺便设置frp相关的nginx配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| server { listen 80 server_name frp.mufei.fun location / { proxy_pass http://127.0.0.1:778 proxy_set_header Host $host proxy_set_header X-Real-IP $remote_addr proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for proxy_hide_header X-Powered-By } location /acg { proxy_pass http://127.0.0.1:6000 proxy_set_header Host $host proxy_set_header X-Real-IP $remote_addr proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for proxy_hide_header X-Powered-By } }
|
当访问frp.mufei.fun
时,讲访问云服务器的127.0.0.1:778
当访问frp.mufei.fun/acg
时,讲访问云服务器的127.0.0.1:6000
而6000正好是frpc客户端的配置端口 22行的位置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| [common]
server_addr = frp.mufei.fun
server_port = 7000
token = mufei123
[static_file_Super] type = tcp
remote_port = 6000 plugin = static_file
plugin_local_path = F:\ACG
plugin_strip_prefix = acg
[rtsp]
type = tcp
local_ip = 192.168.47.1
local_port = 8554
remote_port = 6001
[rtmp]
type = tcp
local_ip = 192.168.47.1
local_port = 1935
remote_port = 6002
[everything] type = http local_ip = 10.39.157.99 local_port = 8001
custom_domains = everything.mufei.fun
|
可能遇到的问题
1.访问界面404
连接的结尾是否有/,否则会被识别成文件,加了/才是文件夹
2.plugin_strip_prefix = acg加了后无法访问
acg这个后缀可以和nginx的转发结合
1 2 3 4 5 6 7
| location /acg { proxy_pass http://127.0.0.1:6000 proxy_set_header Host $host proxy_set_header X-Real-IP $remote_addr proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for proxy_hide_header X-Powered-By }
|