Apache 中的端口转发
我的网络服务器是由内部网络之外的其他用户解析的。问题是它会将我重定向到电脑上的路由器页面。无论如何,要解决这个问题,我必须使用代理来查看我自己的网络服务器,这可能会对我的隐私和代码造成危险。
有解决办法吗?
My web server is resolved from other users outside my internal network. The issue is that it redirects me to the router page on my PC. Anyway to fix this, I have to use a proxy to see my own web server, and it can be dangerous to my privacy and code.
Is there a fix for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有修复,因为这是由您的路由器为了安全而完成的,并且由于请求从您的 IP 返回到您的路由器,它会认为您正在尝试访问您的路由器页面,以便能够查看该站点,只需按照步骤如下:
转到“C:\Windows\System32\Drivers\Etc”并将“HOSTS”文件移动到桌面。
打开它并按照以下步骤操作,但在此示例中,URL 为 STACKOVERFLOW.COM,本地服务器 IP 为 192.168.1.255:
# 版权所有 (c) 1993-1999 Microsoft Corp.
# 这是 Microsoft TCP/IP for Windows 使用的示例 HOSTS 文件。
# 该文件包含 IP 地址到主机名的映射。每个
# 个条目应保留在单独的行中。 IP 地址应该
# 放置在第一列,后跟相应的主机名。
# IP地址和主机名至少用一个分隔
# 个空格。
# 此外,可以在个人上插入评论(例如这些)
# 行或在机器名称后面用“#”符号表示。
192.168.1.255 stackoverflow.com
192.168.1.255 siteb.com
192.168.1.255 sitec.net
复制下划线上方的所有代码,但不要复制下划线。将其粘贴到您的主机文件中并对其进行更改以满足您的需求。将 ip 更改为您服务器的本地 ip,并将您的 url 更改为您用于连接到该站点的 url。只需确保保存文件并将其移回 ETC 文件夹即可!
There is not a fix because that is done for security by your router and since the request is coming back to your router from your ip it will think you are trying to go to your router page so to be able to see the site just follow the following steps:
Go to "C:\Windows\System32\Drivers\Etc" and MOVE the "HOSTS" file to your desktop.
Open it up and follow the steps below but in this example STACKOVERFLOW.COM will be the URL and the local server ip is 192.168.1.255:
# Copyright (c) 1993-1999 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
192.168.1.255 stackoverflow.com
192.168.1.255 siteb.com
192.168.1.255 sitec.net
Copy all the code above the UNDERSCORE but DONT COPY THE UNDERSCORE.Paste it into your hosts file and change it aroud to suite your needs. Change the ip to your servers local ip and your url to the url u use to connect to the site with. Just make sure you SAVE THE FILE AND MOVE IT BACK TO YOUR ETC FOLDER!