Nginx
Links
Zielsetzung
Nginx ist ein Webserver. Er beantwortet HTTP und HTTPS-Anforderungen an den Server.
Dazu benutzt er Subsysteme, die die eigentlichen Applikationen enthalten: PHP, CGI...
Installation
apt-get install nginx-full
# oder
apt-get install nginx
Konfiguration
cat <<EOS > /etc/nginx/snippets/letsencrypt.conf
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /home/www/letsencrypt;
}
# Hide /acme-challenge subdirectory and return 404 on all requests.
# It is somewhat more secure than letting Nginx return 403.
# Ending slash is important!
location = /.well-known/acme-challenge/ {
return 404;
}
EOS
if [ ! -e /srv/www ]; then
mkdir -p /home/www
ln -s ../home/www /srv/www
fi
mkdir -p /srv/www/letsencrypt/.well-known/acme-challenge
echo "Hi" >/srv/www/letsencrypt/.well-known/acme-challenge/hi.txt
echo "Hi" >/srv/www/letsencrypt/.well-known/hi.txt
chown -R www-data:www-data /srv/www/letsencrypt