From 291db3417d0abd82db6b2507228d759bf355ee4e Mon Sep 17 00:00:00 2001 From: cytopia Date: Mon, 17 Oct 2016 04:05:30 +0200 Subject: [PATCH] Adding: nxing --- .devilbox/etc/nginx-stable/00-defaults.conf | 11 +++ .../etc/nginx-stable/01-vhost-default.conf | 56 ++++++++++++++++ .devilbox/etc/nginx-stable/02-vhost-mass.conf | 56 ++++++++++++++++ README.md | 2 +- env-example | 67 ++----------------- 5 files changed, 129 insertions(+), 63 deletions(-) create mode 100644 .devilbox/etc/nginx-stable/00-defaults.conf create mode 100644 .devilbox/etc/nginx-stable/01-vhost-default.conf create mode 100644 .devilbox/etc/nginx-stable/02-vhost-mass.conf diff --git a/.devilbox/etc/nginx-stable/00-defaults.conf b/.devilbox/etc/nginx-stable/00-defaults.conf new file mode 100644 index 00000000..5ac4551b --- /dev/null +++ b/.devilbox/etc/nginx-stable/00-defaults.conf @@ -0,0 +1,11 @@ +access_log /var/log/nginx-stable/access.log main; +error_log /var/log/nginx-stable/error.log warn; + +charset utf-8; + +send_timeout 60; +keepalive_timeout 10; + +sendfile on; +tcp_nopush on; +tcp_nodelay on; diff --git a/.devilbox/etc/nginx-stable/01-vhost-default.conf b/.devilbox/etc/nginx-stable/01-vhost-default.conf new file mode 100644 index 00000000..d03f47b3 --- /dev/null +++ b/.devilbox/etc/nginx-stable/01-vhost-default.conf @@ -0,0 +1,56 @@ +## +## Default Host for http://localhost +## + +server { + listen 80 default_server; + server_name _; + + # Root directive + root /var/www/default/htdocs; + index index.php; + + access_log /var/log/nginx-stable/localhost-access.log main; + error_log /var/log/nginx-stable/localhost-error.log warn; + + + # Front-controller pattern as recommended by the nginx docs + location / { + try_files $uri $uri/ /index.php; + } + + # PHP FPM + location ~ \.php?$ { + # PHP.INI: + # --------------------------- + # // Find this: + # cgi.fix_pathinfo=1 + # // Replace with: + # cgi.fix_pathinfo=0 + + try_files $uri = 404; + include fastcgi_params; + + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_split_path_info ^(.+\.php)(.*)$; + + #### SOCKET + fastcgi_pass 172.16.238.11:9000; + + fastcgi_index index.php; + fastcgi_intercept_errors on; + } + + + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + location ~ /\.ht { + deny all; + } + + # disallow access to git configs path + location ~ /\.git { + deny all; + } +} diff --git a/.devilbox/etc/nginx-stable/02-vhost-mass.conf b/.devilbox/etc/nginx-stable/02-vhost-mass.conf new file mode 100644 index 00000000..4deb308c --- /dev/null +++ b/.devilbox/etc/nginx-stable/02-vhost-mass.conf @@ -0,0 +1,56 @@ +## +## Default Mass Virtual Host +## + +server { + listen 80; + server_name ~^(?.+)\.loc$; + + # Root directive + root /shared/httpd/$domain/htdocs/; + index index.php; + + access_log /var/log/nginx-stable/$domain-access.log main; + error_log /var/log/nginx-stable/other-error.log warn; + + + # Front-controller pattern as recommended by the nginx docs + location / { + try_files $uri $uri/ /index.php; + } + + # PHP FPM + location ~ \.php?$ { + # PHP.INI: + # --------------------------- + # // Find this: + # cgi.fix_pathinfo=1 + # // Replace with: + # cgi.fix_pathinfo=0 + + try_files $uri = 404; + include fastcgi_params; + + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_split_path_info ^(.+\.php)(.*)$; + + #### SOCKET + fastcgi_pass 172.16.238.11:9000; + + fastcgi_index index.php; + fastcgi_intercept_errors on; + } + + + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + location ~ /\.ht { + deny all; + } + + # disallow access to git configs path + location ~ /\.git { + deny all; + } +} diff --git a/README.md b/README.md index 4f418eb4..fdc5e926 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ You can choose any combination of the following docker images during run-time: |-----------|----------|-----| | [Apache 2.2](https://github.com/cytopia/docker-apache-2.2) | [MySQL 5.5](https://github.com/cytopia/docker-mysql-5.5) | [PHP 5.4](https://github.com/cytopia/docker-php-fpm-5.4) | | [Apache 2.4](https://github.com/cytopia/docker-apache-2.4) | MySQL 5.6 | [PHP 5.5](https://github.com/cytopia/docker-php-fpm-5.5) | -| Nginx stable | MySQL 5.7 | [PHP 5.6](https://github.com/cytopia/docker-php-fpm-5.6) | +| [Nginx stable](https://github.com/cytopia/docker-nginx-stable) | MySQL 5.7 | [PHP 5.6](https://github.com/cytopia/docker-php-fpm-5.6) | | Nginx mainline | MariaDB 5 | [PHP 7.0](https://github.com/cytopia/docker-php-fpm-7.0) | | | MariaDB 10 | [PHP 7.1](https://github.com/cytopia/docker-php-fpm-7.1) | diff --git a/env-example b/env-example index aade5433..0ac196c1 100644 --- a/env-example +++ b/env-example @@ -37,8 +37,9 @@ DEBUG_COMPOSE_ENTRYPOINT=0 ### #HTTPD_SERVER=apache-2.2 -HTTPD_SERVER=apache-2.4 -#HTTPD_SERVER=nginx-1 +#HTTPD_SERVER=apache-2.4 +HTTPD_SERVER=nginx-stable +#HTTPD_SERVER=nginx-mainline ### @@ -61,7 +62,6 @@ MYSQL_SERVER=mysql-5.5 PHP_SERVER=php-fpm-5.6 #PHP_SERVER=php-fpm-7.0 #PHP_SERVER=php-fpm-7.1 -#PHP_SERVER=hhvm-3 @@ -87,7 +87,7 @@ TIMEZONE=Europe/Berlin ## Local filesystem path to www projects. ## ## -HOST_PATH_TO_WWW_DOCROOTS=~/Sites +HOST_PATH_TO_WWW_DOCROOTS=./data/www ## ## Local filesystem path to mysql datadir. @@ -99,7 +99,7 @@ HOST_PATH_TO_WWW_DOCROOTS=~/Sites ## If this directory is empty, a new mysql database will be ## created. ## -HOST_PATH_TO_MYSQL_DATADIR=~/data/mysql4 +HOST_PATH_TO_MYSQL_DATADIR=./data/mysql @@ -138,13 +138,6 @@ MYSQL_ROOT_PASSWORD= ### MYSQL_GENERAL_LOG=1 -MYSQL_INNODB_BUFFER_POOL_SIZE=512M -MYSQL_JOIN_BUFFER_SIZE=128M -MYSQL_SORT_BUFFER_SIZE=2M -MYSQL_READ_RND_BUFFER_SIZE=2M -MYSQL_SYMBOLIC_LINKS=0 -MYSQL_SQL_MODE=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES - @@ -169,54 +162,4 @@ PHP_XDEBUG_REMOTE_PORT=9000 # Your local IP address (your computer host [not the docker]) # where your ide/editor is listening for xdebug connections. PHP_XDEBUG_REMOTE_HOST=172.20.10.2 -## TODO: Check if it works by automatically sending it to the broadcast address - - - -### -### PHP Tweaks -### - -# php.ini default setting: -# max_execution_time = 30 -PHP_MAX_EXECUTION_TIME=90 - -# php.ini default setting: -# max_input_time = 60 -PHP_MAX_INPUT_TIME=90 - -# php.ini default setting: -# memory_limit = 128M -PHP_MEMORY_LIMIT=256M - -# php.ini default setting: -# post_max_size = 8M -PHP_POST_MAX_SIZE=100M - -# php.ini default setting: -# upload_max_filesize = 2M -PHP_UPLOAD_MAX_FILESIZE=100M - -# php.ini default setting: -# max_input_vars = 1000 -PHP_MAX_INPUT_VARS=8000 - - - - -### -### PHP Error Handling -### - -# php.ini default setting: -# error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT -PHP_ERROR_REPORTING=E_ALL - -# php.ini default setting: -# display_errors = Off -PHP_DISPLAY_ERRORS=On - -# php.ini default setting: -# track_errors = Off -PHP_TRACK_ERRORS=On