Ubuntu uses Nginx to configure HTTPS server

Source: Internet
Author: User
Reference: http://www.cnblogs.com/yanghuahui/archive/2012/06/25/2561568.html
Http://www.linuxidc.com/Linux/2011-11/47477.htm

http://blog.csdn.net/sean_cd/article/details/38738599


Nginx-v
See if Nginx's SSL configuration is –with-http_ssl_module. If you do not find –with-http_ssl_module This compilation parameter, the description is not supported. Nginx default is not support SSL, need to join the –with-http_ssl_module parameter recompile.
Apt-get Install OpenSSL
cd/etc/nginx/
Create a server private key, and the command will let you enter a password:
OpenSSL genrsa-des3-out Server.key 1024
Create a certificate for the signing request (CSR)
OpenSSL Req-new-key server.key-out SERVER.CSR
Remove the required password when loading SSL-supported Nginx and using the above private key:
OpenSSL rsa-in server.key-out Server_nopwd.key

The last token certificate uses the above private key and the CSR

OpenSSL x509-req-days 365-in server.csr-signkey server_nopwd.key-out server.crt
Vi/etc/nginx/nginx.conf

In the HTTP segment, add:
server {
#listen 80;
Listen 443;
server_name yourservername;
Root/var/mypagedir;
Index index.php index.html index.htm;
SSL on;
SSL_CERTIFICATE/ETC/NGINX/SERVER.CRT;
Ssl_certificate_key/etc/nginx/server_nopwd.key;
}

Restart Niginx

Service Nginx Restart

Put a Web page file in/var/mypagedir, access validation is successful

The above describes Ubuntu using Nginx configuration HTTPS server, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.