ubuntu12.04 nginx Add SSL Authentication

Source: Internet
Author: User
Tags install openssl openssl

1. Installing OpenSSL

sudo apt-get install OpenSSL
sudo apt-get install Libssl-dev

2. Place the corresponding certification file Domain.crt,domain.key under/etc/nginx/ssl

Add the following to the corresponding virtual host configuration file in Site-avaliable

server {
Listen 443;
server_name domain.com;

root/var/www/project folder;
Index index.php index.html index.htm;

SSL on;
SSL_CERTIFICATE/ETC/NGINX/SSL/DOMAIN.CRT;
Ssl_certificate_key/etc/nginx/ssl/domain.key;

Ssl_session_timeout 5m;

Ssl_protocols SSLv3 TLSv1;
Ssl_ciphers all:! Adh:! Export56:rc4+rsa:+high:+medium:+low:+sslv3:+exp;
Ssl_prefer_server_ciphers on;

if (!-e $request _filename) {
Rewrite ^/(. +) $/index.php last;
}

Location/{
Try_files $uri $uri//index.html;
}
}

3. Restart Ngnix

ubuntu12.04 nginx Add SSL Authentication

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.