A bit of a niche topic, however, say you are running:

* nginx
* civicrm
* on a multi-lingual site (ex: English+French)

Aegir will fail to disable the nginx fastcache on CiviCRM URLs. This can cause a lot of confusion when using CiviCRM.

Ex: Search > Contact-Type = Individual. Then quickly change the search parameters to search for Contact-Type = Organization. The search results will still show individuals, not organizations. This also happens for any type of quick update.

Source: ./http/Provision/Config/Nginx/Inc/vhost_include.tpl.php

###
### Avoid caching /civicrm* and protect it from bots.
###
location ^~ /civicrm {
  if ($is_bot) {
    return 403;
  }
  access_log off;
  set $nocache_details "Skip";
  try_files $uri @drupal;
}

Add:

location ~* ^/\w\w/civicrm {
  if ($is_bot) {
    return 403;
  }
  access_log off;
  set $nocache_details "Skip";
  try_files $uri @drupal;
}

In theory, language prefixes could be longer, but CiviCRM only supports 2 letter prefixes (it maps "fr" => "fr_FR").

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bgm created an issue. See original summary.

bgm’s picture

Status: Active » Needs review
memtkmcc’s picture

memtkmcc’s picture

I would propose attached patch. The extra location should come directly after the existing location, because it should catch requests *before* other wildcard requests, if possible. Replacing existing stop-regex location with simple regex location is not desired, for performance reasons.

  • memtkmcc committed 82a5921 on 7.x-3.x
    Issue #2926905 by memtkmcc, bgm: CiviCRM on nginx with multi-lingual:...
memtkmcc’s picture

Assigned: bgm » Unassigned
Status: Needs review » Fixed

Patch committed. Thanks!

bgm’s picture

Works for me. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.