我想知道是否有人能帮我在我的Apache Web服务器上设置CORS。我需要一步一步的过程,因为网上很多站点告诉我不同的东西。例如我需要在我的httpd.conf
或ssl.conf
文件中做什么,在哪里放置我的.htaccess
文件等等。
httpd.conf
中。这应该更改为您设置的任何文档根目录。httpd.conf
位于目录/etc/apache2中,apache2.conf
也位于/etc/apache2中。httpd.conf
位于路径/etc/httpd/conf/httpd中。<Directory "/var/www/html">
Header set Access-Control-Allow-Origin "*"
</Directory>
# 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 "*"
Header set Access-Control-Allow-Origin "*"
放在哪里? - user3851283