Providing Nginx Webserver configuration steps on FreeBSD

This commit is contained in:
byteworkshosting
2013-03-12 12:03:47 +01:00
parent 877add851b
commit c7eccd6086
2 changed files with 96 additions and 0 deletions

View File

@@ -39,6 +39,40 @@ return Array(
'http' => Array( 'http' => Array(
'label' => $lng['admin']['configfiles']['http'], 'label' => $lng['admin']['configfiles']['http'],
'daemons' => Array( '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( 'apache2' => Array(
'label' => 'Apache2 Webserver', 'label' => 'Apache2 Webserver',
'commands' => Array( 'commands' => Array(

View File

@@ -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;
}