diff --git a/lib/configfiles/freebsd.inc.php b/lib/configfiles/freebsd.inc.php index c98ead06..ebb294a4 100644 --- a/lib/configfiles/freebsd.inc.php +++ b/lib/configfiles/freebsd.inc.php @@ -39,6 +39,40 @@ return Array( 'http' => Array( 'label' => $lng['admin']['configfiles']['http'], 'daemons' => Array( + + // Begin: Nginx Config + 'nginx' => array( + 'label' => 'Nginx Webserver', + 'commands_1' => array( + 'cd /usr/ports/www/nginx', + 'make config', + 'set [x] IPv6 protocol (default)', + 'set [x] Enable HTTP module (default)', + 'set [x] Enable http_cache module (default)', + 'set [x] Enable http_gzip_static module', + 'set [x] Enable http_rewrite module (default)', + 'set [x] Enable http_ssl module (default)', + 'set [x] Enable http_stub_status module (default)', + 'make install clean; rehash', + ), + 'commands_2' => array( + $configcommand['vhost'], + $configcommand['diroptions'], + ($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p '. $settings['system']['deactivateddocroot'] : null, + 'mkdir -p '. $settings['system']['documentroot_prefix'], + 'mkdir -p '. $settings['system']['mod_fcgid_tmpdir'], + 'mkdir -p '. $settings['system']['logfiles_directory'], + 'echo "nginx_enable=\"YES\"" >> /etc/rc.conf' + ), + 'files' => array( + 'usr_local_etc_nginx_nginx.conf' => '/usr/local/etc/nginx/nginx.conf', + ), + 'restart' => array( + '/usr/local/etc/rc.d/nginx restart' + ) + ), + // End: Nginx Config + 'apache2' => Array( 'label' => 'Apache2 Webserver', 'commands' => Array( diff --git a/templates/misc/configfiles/freebsd/nginx/usr_local_etc_nginx_nginx.conf b/templates/misc/configfiles/freebsd/nginx/usr_local_etc_nginx_nginx.conf new file mode 100644 index 00000000..a9dc8c55 --- /dev/null +++ b/templates/misc/configfiles/freebsd/nginx/usr_local_etc_nginx_nginx.conf @@ -0,0 +1,62 @@ +### Nginx configuration file ### + +daemon on; +user www www; +worker_processes 4; + +error_log /var/log/nginx/nginx.log crit; +pid /var/run/nginx.pid; + + +events { + use kqueue; + worker_connections 64; + accept_mutex_delay 50ms; +} + + +http { + + access_log /var/log/nginx/access.log; + + include mime.types; + default_type application/octet-stream; + charset utf-8; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + + # Open File Cache + open_file_cache max=512 inactive=20m; + open_file_cache_valid 60s; + open_file_cache_errors on; + + # FastCGI Cache + fastcgi_cache_key "$scheme$request_method$host$request_uri"; + fastcgi_cache_path /var/tmp/nginx levels=1:2 keys_zone=cache:10m inactive=20m max_size=12m; + fastcgi_temp_path /var/tmp/nginx 1 2; + fastcgi_cache cache; + fastcgi_cache_valid 200 20m; + fastcgi_cache_valid 301 302 304 1h; + fastcgi_cache_valid any 1m; + fastcgi_cache_use_stale error timeout invalid_header http_500; + + # SSL + #ssl_client_certificate /path/to/example.pem; + #ssl_crl /path/to/example.crl; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH; + ssl_prefer_server_ciphers on; + ssl_session_cache builtin:256 shared:SSL:64k; + ssl_session_timeout 20m; + + # GZip + gzip on; + gzip_vary on; + gzip_comp_level 6; + gzip_static on; + + include /usr/local/etc/nginx/conf.d/*.conf; + +} \ No newline at end of file