Browse Source

+ webp octobercms support

master
parent
commit
cbb1d79584
  1. 1
      .env.example
  2. 21
      config/nginx/includes.d/octobercms.conf
  3. 14
      config/nginx/includes.d/staticfiles.conf
  4. 1
      docker-compose.base.yml
  5. 3
      dockerfiles/php-fpm/php73.Dockerfile
  6. 1
      dockerfiles/php-fpm/xdebug.ini

1
.env.example

@ -14,6 +14,7 @@ INSTALL_PEAR_MAIL=true
PHP_OPT_SHORT_OPEN_TAG=On
PHP_OPT_MAX_EXECUTION_TIME=600
PHP_OPT_MEMORY_LIMIT=500M
PHP_OPT_POST_MAX_SIZE=200M
PHP_OPT_UPLOAD_MAX_FILESIZE=20M
### MINIO S3 #############################################

21
config/nginx/includes.d/octobercms.conf

@ -6,20 +6,20 @@
rewrite ^/.*$ /index.php last;
expires max;
}
# Whitelist
## Let October handle if static file not exists
location ~ ^/favicon\.ico { try_files $uri /index.php; }
location ~ ^/sitemap\.xml { try_files $uri /index.php; }
location ~ ^/robots\.txt { try_files $uri /index.php; }
location ~ ^/humans\.txt { try_files $uri /index.php; }
location = /favicon.ico { try_files $uri /index.php; }
location = /sitemap.xml { try_files $uri /index.php; }
location = /robots.txt { try_files $uri /index.php; }
location = /humans.txt { try_files $uri /index.php; }
## Let nginx return 404 if static file not exists
location ~ ^/storage/app/uploads/public { try_files $uri /404; }
location ~ ^/storage/app/media { try_files $uri /404; }
location ~ ^/storage/app/yml { try_files $uri /404; }
location ~ ^/files { try_files $uri /404; }
location ~ ^/storage/app/.*\.xls { try_files $uri /404; }
location ~ ^/storage/temp/public { try_files $uri /404; }
#location /storage/app/uploads/public { try_files $uri /404; }
#location /storage/app/media { try_files $uri /404; }
#location /storage/app/yml { try_files $uri /404; }
location /storage/app/resized { try_files $uri /404; }
#location /storage/temp/public { try_files $uri /404; }
location ~ ^/modules/.*/assets { try_files $uri /404; }
location ~ ^/modules/.*/resources { try_files $uri /404; }
@ -48,5 +48,4 @@
access_log off;
expires max;
}
location ~ ^/themes/.*/semantic { try_files $uri /404; }
location ~ ^/themes/.*/resources { try_files $uri /404; }

14
config/nginx/includes.d/staticfiles.conf

@ -1,5 +1,17 @@
#rewrite "^(.*)\.(\d{10})\.(css|js)$" $1.$3 break;
location ~* \.(jpg|jpeg|gif|png|svg|ico)$ {
location ~* \.(gif|svg|ico)$ {
access_log off;
expires max;
log_not_found off;
error_page 404 = /empty;
}
location ~* \.jpge?g$ {
access_log off;
expires max;
log_not_found off;
error_page 404 = /empty;
}
location ~* \.png$ {
access_log off;
expires max;
log_not_found off;

1
docker-compose.base.yml

@ -23,6 +23,7 @@ services:
- PHP_OPT_SHORT_OPEN_TAG=${PHP_OPT_SHORT_OPEN_TAG}
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
- PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE}
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE}
restart: always
volumes:

3
dockerfiles/php-fpm/php73.Dockerfile

@ -45,5 +45,8 @@ RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTI
ARG PHP_OPT_MEMORY_LIMIT=128M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MEMORY_LIMIT=128M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_POST_MAX_SIZE/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=2M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

1
dockerfiles/php-fpm/xdebug.ini

@ -23,3 +23,4 @@ xdebug.trace_enable_trigger=1
xdebug.trace_output_dir=/tmp
xdebug.trace_output_name="trace.%t"
xdebug.show_exception_trace=0
Loading…
Cancel
Save