I performed the blocking of methods other than GET, POST and OPTIONS in apache.conf, and when I try to run the server via IP the blocking works.
But when configuring the same blocking on a subdomain (via sites-available), this blocking does not occur.
What could I have done wrong?
apache2.conf
<Directory /var/www/>
Options None
AllowOverride None
Require all granted
<LimitExcept GET POST OPTIONS>
Require all denied
</LimitExcept>
</Directory>
sites-available/subdomain.example.com.conf
<VirtualHost *:80>
ServerName subdomain.example.com
ServerAlias subdomain.example.com
DocumentRoot /var/www/html/subdomain.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Header append X-FRAME-OPTIONS "SAMEORIGIN"
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /certs/example.crt
SSLCertificateKeyFile /certs/example.key
SSLCertificateChainFile /certs/example-intermediary.crt
Protocols h2 http/1.1
Header always set Strict-Transport-Security "max-age=31536000"
Header append X-FRAME-OPTIONS "SAMEORIGIN"
<Directory /var/www/html/subdomain.example.com>
Options None
AllowOverride None
Require all granted
<LimitExcept GET POST OPTIONS>
Require all denied
</LimitExcept>
</Directory>
ServerName subdomain.example.com
ServerAlias subdomain.example.com
DocumentRoot /var/www/html/subdomain.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
This lock is not working because when executing a request with PUT, DELETE, LOCK, etc, the page content is returned normally.