在我的服务器上,我安装了 Apache HTTP , Tomcat ,需要部署我的 Play 应用程序。
我所拥有和工作的 Apache HTTP 服务器的配置是这样的:
在/etc/httpd/conf/httpd.conf
结束时,我的行代表所有对tomcat的请求。这很好。
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
现在,因为我还需要部署我的 Play 应用程序,所以我在上面的最后两行之前添加了以下内容:
<VirtualHost *:80>
ProxyPreserveHost On
ServerName localhost
ProxyPass /excluded !
ProxyPass /my_play_app http://localhost:9000/my_play_app
ProxyPassReverse /my_play_app http://localhost:9000/my_play_app
</VirtualHost>
问题是当我尝试使用此配置访问播放应用程序时,它没有响应。你能给我一些关于如何解决我的问题的提示吗?
提前致谢。
答案 0 :(得分:1)
我用于Play的nginx配置类似于:
server {
listen 80;
# Without this, Play serves the assets from within it's bundled jar. That's
# fine and works but seems unnecessary when nginx can serve the files directly.
location /assets {
alias /app/live/my-play-app-here/active/public;
}
location / {
proxy_pass http://localhost:9000;
proxy_set_header X-Real-IP $remote_addr;
}
}
This answer有更多细节。