English 中文(简体)
允许某些档案(如字体)只从我的领域提供——具体技术需要
原标题:Allow some files (like fonts) to be served only from my domains -- specific technical need

I have a CDN that serves our static content. From Internap.

To make the CDN urls in my html a bit more palatable, I have a "CNAME" entry in my DNS settings:

cache.mysite.com => CNAME Point to Internap

Internap服务器是一台原始拖车服务器。 因此,我的领域有“/public_html/cache”的倍数,可见于裁谈会。

我在这里提出的一些文件是,我只想从自己的领域服务。

同样重要的是,我的场址落后于Nginx。 这为前线服务器,为诸如tf/woff/eot/cs/js/gif等所有静态档案提供服务。 只有PHP的需求在阿帕奇的后面接近。

我走过了“出入控制-低来源”指令。 Nginx也可这样做( 页: 1

我感到不解的原因是,我有三层人员来为之服务和管理准入:

  • CDN
  • Nginx static server
  • Apache (probably not needed at all as Nginx serves the file to the CDN, and then the CDN takes over?)

我的问题:

  1. How should I specify some select domains in Nginx. The "*" is really not what I need. Will this work for my domains and also covering related subdomains--
location ~* .(eot|ttf|woff)$ {
  add_header Access-Control-Allow-Origin *.domain1.com,*.domain2.com
}
  1. 在Nginx内部,我应具体说明这一组。 在座标书中,涉及I m在哪一个特定领域服务(cache.mysite.com前面提到),或涉及Nginx config?

  2. 我是否完全需要阿帕奇。 如果Nginx正在处理已经使用的网络格式,并控制上网。

感谢!

问题回答

如果浏览器从我们的CDN下载字体,那么没有办法检查头盔。 这是因为Internap在下载的档案中藏匿,否则,CDN会减缓事情,而你的数据交换将保持不变。 可以通过Internap提供只接受某些推荐人的选择。

<代码>Access-Control-Allow-Origin备选办法可能发挥作用,但必须检查,看看CDN是否也把这一标题推向前进。

页: 1 HTTP_REFERRER 检查这些档案是否从你自己的领域查阅。

如果不是的话,你总是可以把他们转头(也可能通过403个错误)。





相关问题
How to set response filename without forcing "save as" dialog

I am returning a stream in some response setting the appropriate content-type header. The behavior I m looking for is this: If the browser is able to render content of the given content type then it ...

Which Http redirects status code to use?

friendfeed.com uses 302. bit.ly uses 301. I had decided to use 303. Do they behave differently in terms of support by browsers ?

Does HttpWebRequest send 200 OK automatically?

Background: I am implementing Paypal IPN handler. This great article on Paypal states that I am required to send a 200 OK back to Paypal after I read the response. The processing of IPN request is ...

Java HTTPAUTH

我试图把桌面应用程序连接起来,我是同D.icio.us api @ Delicious Alan书写的,简单地向他们提供我的用户名和密码,并请他把书记上写给我......。

Finding out where curl was redirected

I m using curl to make php send an http request to some website somewhere and have set CURLOPT_FOLLOWLOCATION to 1 so that it follows redirects. How then, can I find out where it was eventually ...

热门标签