Phusion Passenger 不显示 CSS、Javascript 文件
我安装了 Phusion,配置了 Rails 3.0.10 和 Apache 2,CSS 和 Javascript 等资产显然正在提供服务,但浏览器并未使用。
例如,当我点击根 url 时,页面会呈现,但浏览器不会使用 CSS 和 javascript。我在访问日志中看到针对每个资产的 GET 请求。
我可以直接在浏览器中访问这些资产,转至 stylesheets/application.css?1313636333 我看到正确的 application.css
我在生产日志或 apache 错误日志中没有看到权限错误。
我的虚拟主机看起来像:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName portal.example.com
DocumentRoot /app/example/public
<Directory /app/example/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I have a Phusion install, configured with Rails 3.0.10 and Apache 2, and assets like CSS and Javascript are apparently being served, but not utilized by the browser.
So for instance when I hit the root url, the page renders, but CSS and javascripts are not used by the browser. I see GET requests coming through for each asset in the access logs.
I can visit those assets directly in my browser, going to stylesheets/application.css?1313636333 I see the correct application.css
I dont see permission errors in production logs, or apache error logs.
My VHost looks like:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName portal.example.com
DocumentRoot /app/example/public
<Directory /app/example/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您可以访问静态资产,因此 mime 类型不正确可能是原因。
获取以下输出:
结果应包含“Content-Type:text/css”
Since you can access your static assets, the mime-type incorrectness might be the cause.
Take the output of the following:
the result should contains "Content-Type: text/css"