-
-
Save kapb14/de3546af04bec48e33791a886902c477 to your computer and use it in GitHub Desktop.
nginx configuration for bitrix cms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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