[英]How to capture url requests made by my router?
I'm trying to deploy my own Dynamic DNS service at Dreamhost and following some guides managed to get the server side functioning perfectly - when I open a url the DNS A record for a subdomain gets updated. 我正在尝试在Dreamhost上部署我自己的动态DNS服务,并按照一些指南设法使服务器端正常运行-当我打开url时,将更新子域的DNS A记录。
But when I place the data on the router and try to make it work (following the standards at dyndns or no-ip) the router fails to update. 但是,当我将数据放在路由器上并尝试使其工作时(遵循dyndns或no-ip的标准),路由器无法更新。
Here's what I have: 1. Server side works as I expected. 这是我所拥有的:1.服务器端按预期工作。 2. Router works when using the default services (tested with no-ip) to update IP.
2.使用默认服务(经no-ip测试)更新IP时,路由器可以工作。 3. If I fail the authentication on my server, then router throws an auth failed error - it's accessing the server and authenticating.
3.如果我在服务器上的身份验证失败,则路由器会引发身份验证失败错误-它正在访问服务器并进行身份验证。 4. Tried logging to see if at any point the script is even accessed, and it's not.
4.尝试记录日志,以查看是否在任何时候都可以访问脚本,是否可以访问脚本。
So I think the router is requesting a url that is different than I expect. 因此,我认为路由器请求的URL与我预期的不同。 I tried with /, white /update/ and with /nic/update/
我尝试使用/,白色/ update /和/ nic / update /
At this point I wanted to see what the router is actually requesting. 在这一点上,我想看看路由器的实际要求。 Fired up XAMPP, installed Wireshark, and tried to set the router to update my own computer.
启动XAMPP,安装Wireshark,并尝试设置路由器以更新我自己的计算机。 Found the requests and found a 301 response since the router is asking for /nic/update?
因为路由器要求/ nic / update,所以找到了请求并找到了301响应? and I have it on /nic/update/?.
我在/ nic / update /?上有它。
Browser handles this redirect transparently but the router seems to not be requesting the new url. 浏览器透明地处理此重定向,但路由器似乎未在请求新的URL。 Might need to mess with mod_rewrite?
可能需要弄乱mod_rewrite吗?
As suspected, the router was taking the redirect as a bad reply. 如怀疑的那样,路由器将重定向视为错误回复。 After messing around with mod_rewrite I got it to work.
在弄乱了mod_rewrite之后,我开始使用它。
Used this: 使用这个:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.cgi [L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.