Skip to content

Instantly share code, notes, and snippets.

@dragolabs
Created September 11, 2015 11:28
Show Gist options
  • Save dragolabs/2fa71c0007a9f50a5c50 to your computer and use it in GitHub Desktop.
Save dragolabs/2fa71c0007a9f50a5c50 to your computer and use it in GitHub Desktop.
nginx configuration for bitrix cms
server {
listen 80;
server_name bitrix.example.com;
client_max_body_size 200m;
root /var/www/bitrix;
index index.html index.php;
access_log /var/log/nginx/bitrix.access.log;
error_log /var/log/nginx/bitrix.error.log;
location / {
try_files $uri $uri/ @bitrix;
}
location ~ ^/(.svn|.ht|bitrix/modules|upload/support/not_image|bitrix/php_interface) {
return 404;
}
location ~* ^/.*(jpg|jpeg|gif|png|psd|ico|css|html|swf|rar|zip|qz|7z|doc|xls|pdf|avi|mp3|js|docx|doc)$ {
log_not_found off;
access_log off;
expires max;
error_page 404 = /404.php;
}
location ~ \.php$ {
try_files $uri @bitrix;
include fastcgi_params;
fastcgi_pass 127.0.0.1:10001;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location @bitrix {
rewrite ^/detail/(.*[^/])$ /detail/$1/ permanent;
fastcgi_pass 127.0.0.1:10001;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/bitrix/urlrewrite.php;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment