Skip to content

Instantly share code, notes, and snippets.

@lihonosov
Created July 28, 2014 08:42
Show Gist options
  • Save lihonosov/b03074ff2501b143b91a to your computer and use it in GitHub Desktop.
Save lihonosov/b03074ff2501b143b91a to your computer and use it in GitHub Desktop.
Дружим nginx + ssl
touch /etc/nginx/ssl.conf
# Подключение самоподписанного сертификата
# генерация сертификата:
# openssl req -new -x509 -days 9999 -nodes -out cert.pem -keyout cert.key
ssl on;
ssl_protocols SSLv3 TLSv1;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/cert.key;
mkdir /etc/nginx/ssl
chown www-data:www-data /etc/nginx/ssl
chmod 700 /etc/nginx/ssl
cd /etc/nginx/ssl
openssl req -new -x509 -days 9999 -nodes -out cert.pem -keyout cert.key
listen 443; # порт https
include /etc/nginx/ssl.conf; # подключение конфигурации ssl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment