diff --git a/Dockerfile b/Dockerfile index 996e2d6..3d7feb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN wget http://nginx.org/keys/nginx_signing.key && \ ADD nginx.conf /app/code/nginx.conf.default ADD public /app/code/public.default -ADD fpm.conf /etc/php/7.0/fpm/php-fpm.conf +ADD fpm.conf /etc/php/7.2/fpm/php-fpm.conf ADD start.sh /app/code/start.sh RUN mkdir /run/nginx && \ diff --git a/nginx.conf b/nginx.conf index fe39270..fb9bce8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -14,13 +14,21 @@ http { sendfile on; keepalive_timeout 65; + gzip on; + gzip_http_version 1.1; + gzip_vary on; + gzip_comp_level 6; + gzip_proxied any; + gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js; + gzip_buffers 16 8k; + server { listen 8000; root /app/data/public; index index.php index.html index.htm; - try_files $uri $uri/ =404; + try_files $uri $uri/index.html $uri/ =404; absolute_redirect off; # Uncomment to add a redirect @@ -55,6 +63,17 @@ http { location ~ /\.ht { deny all; } + + # Cache statif files + location ~* \.html$ { + expires 1h; + } + + location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|mp3|ttf|css|rss|atom|js|jpg|jpeg|webp|webm|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)(\?.+)?$ { + access_log off; + log_not_found off; + expires max; + } } } diff --git a/start.sh b/start.sh index 1a4e912..eb4eae1 100755 --- a/start.sh +++ b/start.sh @@ -14,5 +14,5 @@ chown -R cloudron:cloudron /app/data export HOME=/app/data -/usr/sbin/php-fpm7.0 & +/usr/sbin/php-fpm7.2 & exec /usr/sbin/nginx -c /app/data/nginx.conf -g 'daemon off;'