如何为Apache httpd服务器启用CORS? (分步过程) [英] How to Enable CORS for Apache httpd server? (Step-By-Step Process)
本文介绍了如何为Apache httpd服务器启用CORS? (分步过程)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否有人可以帮助我在Apache Web服务器上设置CORS。我希望逐步执行此过程,因为许多在线站点都在告诉我不同的事情。就像我需要对httpd.conf或ssl.conf文件执行的操作,将.htaccess文件放在何处等。
I was wondering if anybody can help me set up CORS on my Apache web server. I would appreciate a step-by-step process because many sites online are telling me different things. Like what do I need to do on my httpd.conf or ssl.conf files, where to put my .htaccess file, etc.
任何帮助将不胜感激。谢谢!
Any help would be appreciated. Thanks!
推荐答案
# edit your conf/httpd.conf file. Verify that the headers module is loaded
LoadModule headers_module modules/mod_headers.so
# to whitelist every origin, use
Header set Access-Control-Allow-Origin "*"
更多信息: http://enable-cors.org/server_apache.html
这篇关于如何为Apache httpd服务器启用CORS? (分步过程)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文