drupal-project icon indicating copy to clipboard operation
drupal-project copied to clipboard

Add 404 status for MS 365 autodiscover requests and omit log entries

Open tormi opened this issue 3 years ago • 2 comments

Sth like this:

nginx:
  extra_conditions: |
    # 404 status for MS 365 autodiscover requests and omit log entries
    location ~ /autodiscover/autodiscover.xml {
      return 404;
      access_log off;
      log_not_found off;
    }

Slack: https://wunder.slack.com/archives/C8UN6AG9W/p1647591467861449

tormi avatar Sep 20 '22 13:09 tormi

Saimons Jēgers:

Actually in Artis copied text both use cases say that it’s used for case-insensitive scenarios which doesn’t look right. It’s a typo on that blog/site. Link to it And this is just above the text:

~: The tilde sign is used for case-sensitive regular expression match against a requested URI.
~*: The tilde followed by asterisk sign is used for case insensitive regular expression match against a requested URI.

So it should be ~* after all.

tormi avatar Sep 22 '22 08:09 tormi

This should be the correct one:

  locationExtraConfig: |
    # Add 404 status for autodiscover.xml requests and omit log entries.
    location ~* /autodiscover/autodiscover.xml {
      return 404;
      access_log off;
      log_not_found off;
    }

tormi avatar Sep 23 '22 17:09 tormi