这个问题的主题是我最好的猜测罪魁祸首,但我不知道我相信它。总之,我的问题是:我的Sinatra应用程序出了什么问题?在Apache后面反向代理时缺少路由吗?
这里的设置:
- 我在路线之一有
post '/attachments/go' do …
。 我有自己的看法下列操作之一:
<form action="/attachments/go" enctype="multipart/form-data" method="post"> <input name="attachments[]" type="file" multiple="multiple"> <button type="submit">upload</button> </form>
我有不同的端口上运行我的应用程序的两种情况。
我的Apache设置为反向代理:
… <Proxy balancer://myapp/> BalancerMember http://127.0.0.1:3006 BalancerMember http://127.0.0.1:3007 ProxySet lbmethod=bybusyness </Proxy> … <VirtualHost *:80> ServerName myapp.mycompany.com ServerAlias myapp DocumentRoot "C:/www/myapp/public" ProxyPass /css ! ProxyPass /js ! ProxyPass /images ! ProxyPass /attachments ! ProxyPass /balancer://myapp/ ProxyPassReverse/balancer://myapp/ </VirtualHost>
下面是症状:
当我打开我的应用程序直接(
thin start -e production -p 5142
)一切正常。我可以发布表单并接收文件。这也适用于开发模式。当我通过反向代理负载我的应用程序和发布形式,我得到一个404响应:
The requested URL /attachments/go was not found on this server.
我知道这是没有太多去,但:任何猜测到为什么会发生这种情况,以及如何解决它?