diff --git a/conf/nginx.conf b/conf/nginx.conf index 2e7ac71..ec4b8d3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,46 +1,33 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/www/; + # Path to source + alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } + # Force usage of https + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } - # Default indexes and catch-all - index index.html index.php; - try_files $uri $uri/ __PATH__/index.php?$args; +### Example PHP configuration (remove it if not used) + index index.php; - # Prevent useless logs - location = __PATH__/favicon.ico { - log_not_found off; - access_log off; - } - location = __PATH__/robots.txt { - allow all; - log_not_found off; - access_log off; - } + # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file + #client_max_body_size 50M; - # Deny access to hidden files and directories - location ~ ^__PATH__/(.+/|)\.(?!well-known\/) { - deny all; - } + try_files $uri $uri/ index.php; + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; - # Execute and serve PHP files - location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; - } + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_FILENAME $request_filename; + } ### End of PHP configuration part - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } \ No newline at end of file diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 1f4f865..60da25a 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -427,10 +427,4 @@ chdir = __FINALPATH__ ; php_admin_value[max_execution_time] = 600 ; php_admin_value[max_input_time] = 300 ; php_admin_value[memory_limit] = 256M -; php_admin_flag[short_open_tag] = On - -; Additional php.ini defines, specific to this pool of workers. -php_value[upload_max_filesize] = 1G -php_value[post_max_size] = 1G -php_value[default_charset] = UTF-8 -php_value[always_populate_raw_post_data] = -1 \ No newline at end of file +; php_admin_flag[short_open_tag] = On \ No newline at end of file