Freifunk

Webserver Configuration

acmetool

echo 'deb http://ppa.launchpad.net/hlandau/rhea/ubuntu xenial main' | sudo tee /etc/apt/sources.list.d/rhea.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9862409EF124EC763B84972FF5AC9651EDB58DFA
sudo apt-get update
sudo apt-get install acmetool
sudo acmetool quickstart --expert
  • Live
  • RSA
  • 3072
  • WEBROOT
  • /var/lib/acme/challenge
  • Yes (Continue with webroot)
  • Yes (Configure Cronjob)
  • OK (Exit)

nginx

/etc/nginx/nginx.conf

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# SSL Settings
	##

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
	ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES128-GCM-SHA256 EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3D
ES !MD5 !EXP !PSK !SRP !DSS";
	ssl_prefer_server_ciphers on;

	ssl_session_cache builtin:1000 shared:SSL:10m;
	ssl_session_timeout 5m;
	ssl_stapling on;
	ssl_stapling_verify on;
	ssl_ecdh_curve secp384r1;
	ssl_dhparam /etc/nginx/ssl/dh.pem;

	##
	# Logging Settings
	##

	log_format main '::1 - $remote_user [$time_local]  '
		'"$request" $status $body_bytes_sent '
		'"$http_referer" "$http_user_agent"';

	access_log /var/log/nginx/access.log main;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	gzip_vary on;
	gzip_proxied any;
	gzip_comp_level 6;
	gzip_buffers 16 8k;
	gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# Caching
	##
	proxy_cache_path /tmp/ngx-proxy-cache levels=1:2 keys_zone=proxycache:32m inactive=30m max_size=100m;

	##
	# Virtual Host Configs
	##

	include /etc/nginx/sites-enabled/*;
}
sudo openssl dhparam -out /etc/nginx/ssl/dh.pem 2048