diff options
author | Frédéric Guillot <fred@kanboard.net> | 2017-11-30 16:47:52 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2017-11-30 16:55:53 -0800 |
commit | 55547db6ce691a71d19a502178c2a9e00a303dd5 (patch) | |
tree | 41197ca843b9b0d5f47e6b22e5bcc00a4aa37b68 /docker/etc/nginx | |
parent | 12202f04511c14844641edce879afd81e10e767b (diff) |
Improve docker build to use hooks
Diffstat (limited to 'docker/etc/nginx')
-rw-r--r-- | docker/etc/nginx/nginx.conf | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/docker/etc/nginx/nginx.conf b/docker/etc/nginx/nginx.conf new file mode 100644 index 00000000..6ba545f6 --- /dev/null +++ b/docker/etc/nginx/nginx.conf @@ -0,0 +1,69 @@ +user nginx; +worker_processes 1; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + server_tokens off; + access_log off; + error_log /dev/stderr; + + server { + listen 80; + server_name localhost; + index index.php; + root /var/www/app; + client_max_body_size 32M; + + location / { + try_files $uri $uri/ /index.php$is_args$args; + } + + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/var/run/php-fpm.sock; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_index index.php; + include fastcgi_params; + } + + location ~* ^.+\.(log|sqlite)$ { + return 404; + } + + location ~ /\.ht { + return 404; + } + + location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ { + log_not_found off; + expires 7d; + etag on; + } + + gzip on; + gzip_comp_level 3; + gzip_disable "msie6"; + gzip_vary on; + gzip_types + text/javascript + application/javascript + application/json + text/xml + application/xml + application/rss+xml + text/css + text/plain; + } +} |