root /home/u1/domains/example.com;

location / {
  try_files $uri $uri/ @bitrix;
}

location @bitrix {
  include fastcgi_params;
  fastcgi_pass unix:/var/run/php5-example.com.sock;
  fastcgi_intercept_errors on;
  fastcgi_param SCRIPT_FILENAME $document_root/bitrix/urlrewrite.php;
}

location ~ \.php$ {
  try_files $uri @bitrix;
  include fastcgi_params;
  fastcgi_pass unix:/var/run/php5-example.com.sock;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ^~ /bitrix/admin/ {
  try_files $uri @bitrixadm;
  fastcgi_pass unix:/var/run/php5-example.com.sock;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  include fastcgi_params;
}

location @bitrixadm {
  fastcgi_pass unix:/var/run/php5-example.com.sock;
  include fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $document_root/bitrix/admin/404.php;
}

location = /favicon.ico {
  access_log off;
}

location = /robots.txt {
  allow all;
  access_log off;
}

location ~ (/bitrix/modules|/upload/support/not_image|/bitrix/php_interface) {
  deny all;
}

location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ {
  access_log off;
  expires max;
}

location ~ /\. {
  deny all;
}
