nginx-custom.conf 1.89 KB
Newer Older
1 2 3 4 5 6 7 8 9
rewrite ^/casestudy/node/(.*)$ /node/$1 permanent;
rewrite ^/case-studies/node/(.*)$ /node/$1 permanent;
rewrite ^/casestudy/(.*)$ /case-studies/$1 permanent;
rewrite ^/casestudy/(.*)$ /case-studies/$1 permanent;

rewrite ^/providers/Skvare.+ /providers/Skvare permanent;

rewrite ^/inapp/civiconnect-firewall$ https://github.com/civicrm/civicrm-cxn-rpc/blob/master/doc/proxy.md redirect;

totten's avatar
totten committed
10 11
rewrite ^/get-buildkit.sh$ https://raw.githubusercontent.com/civicrm/civicrm-buildkit/master/bin/civi-download-tools redirect;

12
rewrite ^/blogs/(.*)$ /blog/$1 permanent;
13

14 15 16 17 18 19
# Enable access to files/civicrm/custom/images/
location ~* ^/sites/civicrm.org/files/civicrm/custom/image {
  access_log off;
  try_files $uri =404;
}

20 21 22
# For compatibility with pre/post Aegir
# nb: eventually add 'permanent' redirect?
rewrite ^/sites/all/themes/(.*)$ /sites/$host/themes/$1;
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
rewrite ^/sites/default/files/(.*)$ /sites/$host/files/$1 permanent;

# Attempt better caching of CiviCRM images
# but this is probably not having a huge impact.
location ^~ /civicrm/contact/imagefile {
  if ($is_bot) {
    return 403;
  }

  access_log on;

  set $nocache_details "Cache";
  fastcgi_cache_valid 200 24h;

  try_files $uri @drupal;
}
39 40 41 42 43 44 45 46 47 48 49 50

###########################################################
# Re-route /extdir/* to Symfony app
set $symfonyRoot /var/www/extdir/web;
set $symfonyScript app.php;

location /extdir-symfony/ {
  root $symfonyRoot;
  rewrite ^/extdir-symfony/(.*)$ /$1 break;
  try_files $uri @symfonyFront;
}

51 52 53 54 55
location /extdir/ {
  root $symfonyRoot;
  rewrite ^/extdir/(.*)$ /$1 break;
  try_files $uri @symfonyFront;
}
56 57 58 59 60 61 62 63 64

location @symfonyFront {
  #x fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  include /etc/nginx/fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $symfonyRoot/$symfonyScript;
  fastcgi_param SCRIPT_NAME /extdir/$symfonyScript;
  fastcgi_param REQUEST_URI /extdir$uri?$args;
}