我有一个域(例如example.net ),运行在端口443上的Apache实例。在与example.com相同的主机上,我有一个运行在端口9000上的web应用程序,所以我可以访问它,如果我去https://example.net:9000在我的浏览器中。
我想要的是添加一些条目到我的Apacheconfiguration,使我可以通过一个更好的链接访问端口9000上运行的应用程序,如http://example.net/my-app 。
我努力了
<Location /my-app/> ProxyPass http://localhost:9000/ ProxyPassReverse http://localhost:9000/ </Location>
我确实可以检索my-app程序my-app程序的索引,但它混淆了页面上的所有Javascript和CSS引用。
我想要的东西,将完全模仿当我去example.net:9000时会发生什么。
你可以试试别名 。
<VirtualHost *:80> ServerName example.net DocumentRoot /path/here Alias /my-app /path/to/myapp <Directory /path/to/myapp> Require all granted </Directory> </VirtualHost>
如果你去http://example.net ,上面的设置会从/ path / here返回文件,如果你去http://example.net/my-app ,会从/ path /到/ myapp返回文件。