Skip to content

Instantly share code, notes, and snippets.

@fat4lix
Created April 24, 2019 07:51
Show Gist options
  • Select an option

  • Save fat4lix/691d2a829553f493542bad4950c8cb35 to your computer and use it in GitHub Desktop.

Select an option

Save fat4lix/691d2a829553f493542bad4950c8cb35 to your computer and use it in GitHub Desktop.
asdasd
server {
listen 80 default;
server_name shop.streamity.test;
charset utf-8;
root /var/www;
index index.php index.html bitrixsetup.php;
client_max_body_size 1024m;
access_log /var/log/nginx/bitrix-access.log;
error_log /var/log/nginx/bitrix-error.log;
if (!-e $request_filename) {
rewrite ^(.*)$ /bitrix/urlrewrite.php last;
}
location / {
if (-f /var/www/index.php) {
root /var/www;
break;
}
if (-f /var/www/bitrixsetup.php) {
root /var/www;
break;
}
try_files $uri $uri/ @shop.streamity.test;
root /var/www/html;
}
location @shop.streamity.test {
fastcgi_pass php-upstream;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/bitrix/urlrewrite.php;
}
location ~ \.php$ {
if (!-f $request_filename) {
rewrite ^(.*)/index.php$ $1/ redirect;
}
include fastcgi_params;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_send_timeout 21600;
fastcgi_read_timeout 21600;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location = /restore.php {
include fastcgi_params;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_send_timeout 21600;
fastcgi_read_timeout 21600;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
client_body_buffer_size 1024m;
client_max_body_size 1024m;
}
location ~ /upload/ {
client_body_buffer_size 1024m;
client_max_body_size 1024m;
}
location = /favicon.png {
log_not_found off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|eot|otf|ttf|woff|woff2)$ {
log_not_found off;
access_log off;
expires 30d;
add_header Cache-Control public;
}
location ~ (/bitrix/modules|/upload/support/not_image|/bitrix/php_interface|local/modules|local/php_interface) {
deny all;
}
location ~ /.git/ {
deny all;
}
location ~ /vendor/ {
deny all;
}
location ~ /composer {
deny all;
}
location ~ /.gitignore {
deny all;
}
error_page 404 /404.html;
location /404.html {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment