From 25cb6cdfb3fed03ad6368a0e68b9f1f6b676b32d Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Mon, 10 Apr 2017 15:56:15 +0300 Subject: [PATCH] Installation: correct configuration for nginx server --- install/core/config.php | 76 ++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/install/core/config.php b/install/core/config.php index 45105fa64e..e455086fea 100644 --- a/install/core/config.php +++ b/install/core/config.php @@ -72,44 +72,50 @@ service apache2 restart', 'APACHE3' => 'service apache2 restart', 'APACHE4' => '# RewriteBase /', 'APACHE5' => 'RewriteBase {ESPO_PATH}{API_PATH}', - 'NGINX' => 'location /api/v1/ { - if (!-e $request_filename){ - rewrite ^/api/v1/(.*)$ /api/v1/index.php last; break; - } -} + 'NGINX' => 'server { + # ... -location ~ /reset/?$ { - try_files /reset.html =404; -} + client_max_body_size 50M; -location ^~ (data|api)/ { - if (-e $request_filename){ - return 403; + location /api/v1/ { + if (!-e $request_filename){ + rewrite ^/api/v1/(.*)$ /api/v1/index.php last; break; + } + } + + location ~ /reset/?$ { + try_files /reset.html =404; + } + + location ^~ (data|api)/ { + if (-e $request_filename){ + return 403; + } + } + location ^~ /data/logs/ { + deny all; + } + location ^~ /data/config.php { + deny all; + } + location ^~ /data/cache/ { + deny all; + } + location ^~ /data/upload/ { + deny all; + } + location ^~ /application/ { + deny all; + } + location ^~ /custom/ { + deny all; + } + location ^~ /vendor/ { + deny all; + } + location ~ /\.ht { + deny all; } -} -location ^~ /data/logs/ { - deny all; -} -location ^~ /data/config.php { - deny all; -} -location ^~ /data/cache/ { - deny all; -} -location ^~ /data/upload/ { - deny all; -} -location ^~ /application/ { - deny all; -} -location ^~ /custom/ { - deny all; -} -location ^~ /vendor/ { - deny all; -} -location ~ /\.ht { - deny all; }', ),