My vhost config:
<VirtualHost *:3000>
ServerAdmin webmaster@localhost
DocumentRoot "/var/www/bag-design/bag-design-web/build"
DirectoryIndex index.html
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS, PATCH"
Header always set Access-Control-Allow-Headers "*"
<Directory "/var/www/bag-design/bag-design-web/build">
AllowOverride All
Order allow,deny
Allow from All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/bag_design_error.log
CustomLog ${APACHE_LOG_DIR}/bag_design_access.log combined
</VirtualHost>
<VirtualHost *:3001>
ServerAdmin webmaster@localhost
DocumentRoot "/var/www/bag-design/bag-design-api/dist"
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS, PATCH"
Header always set Access-Control-Allow-Headers "*"
<Directory "/var/www/bag-design/bag-design-api/dist">
AllowOverride All
Order allow,deny
Allow from All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/bag_design_error.log
CustomLog ${APACHE_LOG_DIR}/bag_design_access.log combined
</VirtualHost>
But when I try to make a PATCH request the response is 405 and I get the following headers:
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, PATCH
Access-Control-Allow-Origin: *
Allow: GET, POST, PUT, DELETE, OPTIONS, PATCH
Allow: OPTIONS,HEAD,GET,POST
Connection: Keep-Alive
Content-Length: 301
Content-Type: text/html; charset=iso-8859-1
Date: Wed, 18 Jan 2023 10:31:50 GMT
Keep-Alive: timeout=5, max=99
Server: Apache/2.4.52 (Ubuntu)
My question is how can I override the Allow header?
I did try to append, unset, set, add, merge this header using Header "method" Allow "PATCH"
But nothing worked.