php - 无法让 SSL 站点正确加载 JS + CSS。 throw 409(冲突)

标签 php codeigniter ssl nginx

我正在使用 nginxcodeigniter 来为我的网站提供服务。 当没有代理时,我能够正确加载 ssl 站点。

但是当代理后面的计算机试图访问它时,就会出现 409 冲突。

它能够在代理后面正确加载非 ssl 站点。

这是 nginx conf 中的 ssl 代码块:

Pastie Nginx Conf

奇怪的是,当我直接打开 css 或 js 文件时(例如,在浏览器中输入 css url),它会正确加载它。

这是返回 409 冲突的 Assets 的响应 + 请求 header 。

请求 header :

Accept:text/css,*/*;q=0.1
Accept-Encoding:gzip,deflate
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Cookie:ci_session=ca41f4c9930b678f07acb9a45c839b63
Host:www.mywebsite.com
If-Modified-Since:Wed, 24 Sep 2014 01:13:00 GMT
If-None-Match:"54221a9c-1da51"
Referer:https://www.mywebsite.com/
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)         Chrome/37.0.2062.120 Safari/537.36

响应头:

Cache-Control:no-cache
Connection:close
Content-Length:1256
Content-Type:text/html; charset=utf-8
Pragma:no-cache
Proxy-Connection:close

在 FF 中浏览时抛出这个:

An error occurred during a connection to www.mywebsite.com. Certificate type not approved for application. (Error code: sec_error_inadequate_cert_type) 

提供静态 Assets 不起作用..

最佳答案

nginx 文档和 w3 文档都可以让您更好地理解问题。似乎问题可能与跨代理传递请求时的冲突有关。这意味着代理正在更改请求参数。如果不查看和比较来自两个请求的日志,就很难分辨出差异在哪里。

查看这些链接:

http://nginx.com/resources/admin-guide/nginx-ssl-termination/

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

还要确保您的 CSS 和 JS 请求在缓存方面可能有所不同,因此代理可能会保持请求原样。

关于php - 无法让 SSL 站点正确加载 JS + CSS。 throw 409(冲突),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26079415/

相关文章:

git - 将 GIT 用于在多个位置具有目录的项目

php - 如何在 Codeigniter RSA 库中生成签名和 key

apache - htaccess 重写多个条件

PHP - 将 12 小时格式时间转换为新时区时出现错误

php - 每个周期索引一个数组(以秒为单位)

php - Codeigniter 中的独特字段

ssl - 关于TLS/SSL,为什么要一次性删除Pre_master_secret?

ssl - Consul https 支持 spring boot 应用程序

php - 在哪里保存临时数据?

php - 平面文件数据库