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").
Comment | File | Size | Author |
---|---|---|---|
#4 | 0001-Issue-2926905-CiviCRM-on-nginx-with-multi-lingual-di.patch | 1012 bytes | memtkmcc |
Comments
Comment #2
bgm CreditAttribution: bgm commentedPR: https://github.com/aegir-project/provision/pull/16
Comment #3
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedJust commented at https://github.com/aegir-project/provision/pull/16#issuecomment-357277846
Comment #4
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedI 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.
Comment #6
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedPatch committed. Thanks!
Comment #7
bgm CreditAttribution: bgm commentedWorks for me. Thanks!