Hello,
I'm just setting small connection to PostgreSQL database from website and I can't enable CORS in Apache 2.4 on FreeBSD. While ago I have enabled it in Apache 2.4 on RedHat with success, and I dont know what am I doing wrong now.
I added these lines to my httpd.config :
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "*"
Header set Access-Control-Allow-Methods "POST, GET"
I'm still getting an error:
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Some ppl on web tell to use a2enmod to enable headers, but I don't have such command (both unix and linux). How can I enable them??
I can see that there is a lot of LoadModules in httpd.config by default, while there was none of them on RedHat. So I suppouse that one of them could disable cors. Do you know which one??
I will be thankfull for any help.
Cheers.
I'm just setting small connection to PostgreSQL database from website and I can't enable CORS in Apache 2.4 on FreeBSD. While ago I have enabled it in Apache 2.4 on RedHat with success, and I dont know what am I doing wrong now.
I added these lines to my httpd.config :
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "*"
Header set Access-Control-Allow-Methods "POST, GET"
I'm still getting an error:
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Some ppl on web tell to use a2enmod to enable headers, but I don't have such command (both unix and linux). How can I enable them??
I can see that there is a lot of LoadModules in httpd.config by default, while there was none of them on RedHat. So I suppouse that one of them could disable cors. Do you know which one??
Code:
LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
LoadModule authn_file_module libexec/apache24/mod_authn_file.so
LoadModule authn_core_module libexec/apache24/mod_authn_core.so
LoadModule authz_host_module libexec/apache24/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache24/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache24/mod_authz_user.so
LoadModule authz_core_module libexec/apache24/mod_authz_core.so
LoadModule access_compat_module libexec/apache24/mod_access_compat.so
LoadModule auth_basic_module libexec/apache24/mod_auth_basic.so
LoadModule reqtimeout_module libexec/apache24/mod_reqtimeout.so
LoadModule filter_module libexec/apache24/mod_filter.so
LoadModule mime_module libexec/apache24/mod_mime.so
LoadModule log_config_module libexec/apache24/mod_log_config.so
LoadModule env_module libexec/apache24/mod_env.so
LoadModule headers_module libexec/apache24/mod_headers.so
LoadModule setenvif_module libexec/apache24/mod_setenvif.so
LoadModule version_module libexec/apache24/mod_version.so
LoadModule unixd_module libexec/apache24/mod_unixd.so
LoadModule status_module libexec/apache24/mod_status.so
LoadModule autoindex_module libexec/apache24/mod_autoindex.so
LoadModule dir_module libexec/apache24/mod_dir.so
LoadModule alias_module libexec/apache24/mod_alias.so
IncludeOptional etc/apache24/modules.d/[0-9][0-9][0-9]_*.conf
I will be thankfull for any help.
Cheers.