我有一个本地开发盒,可以使用apache2和catchall通配符子域,dnsmasq和本地网站进行设置。由于本地站点上的Web应用程序不允许多个浏览器从同一位置/域登录,因此此设置便于使用多个浏览器进行测试。除非我尝试在iframes src网址中测试iframe并使用通配符子域,否则此系统效果很好。之后我得到一个页面未找到错误。
从您可以在此页面底部查看的错误消息中包含的URL中可以看出,似乎游戏中虚拟主机的apache配置文件与jsgame中的重定向之间可能存在一些冲突,但我是如何修复它不知所措。任何人都可以建议如何解决这个问题?
操作系统是Debian 6,这就是我的系统设置方式。
的Apache
在etc / apache2 / sites-available / game
中<VirtualHost *:80>
ServerName catchall.game
ServerAlias *.game
VirtualDocumentRoot /var/www/%1
</VirtualHost>
#
<VirtualHost *:80>
ServerName mplayer.game
ServerAlias *.game
DocumentRoot /var/www/game/public
</VirtualHost>
网站
在etc / apache2 / sites_available / jsgame
中Alias /jsgame/ usr/share/jsgame
RedirectMatch ^/jsgame/?$ /jsgame/example/index.html
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /JSGAME_REST http://127.0.0.1:19384/JSGAME_REST retry=1
ProxyPass /AVATAR http://127.0.0.1:19384/AVATAR retry=1
ProxyPass /UPLOAD http://127.0.0.1:19384/UPLOAD retry=1
的dnsmasq
在etc / dnsmasq.conf中的第62行# Add domains which you want to force to an IP address here.
# The example below send any host in doubleclick.net to a local
# webserver.
address=/.game/127.0.0.1
的index.html
通过以下方式访问Web应用程序:
master.game/jsgame/example/index.html?game_id=45
IFRAME
/jsgame/example/index.html
中的iframe代码<iframe id="player0" width="25%" height="25%" src="player0.game/jsgame/pts1.html" style="position:absolute;left:0px;top:0"></iframe>
我从iframe中收到此错误:
在此服务器上找不到请求的网址/jsgame/example/player0.game/pts1.html。
我希望网址为:
player0.game/example/pts1.html不是如上所示。
答案 0 :(得分:0)
如果您使用http://player0.game/jsgame/pts1.html
代替player0.game/jsgame/pts1.html
作为iframe的src
属性,该怎么办?
<iframe
id="player0"
width="25%"
height="25%"
src="http://player0.game/jsgame/pts1.html"
style="position:absolute;left:0px;top:0">
</iframe>
这将避免被视为亲戚。