Nginx configuration NameCheap free SSL

Source: Internet
Author: User
Tags free ssl

Nginx configuration NameCheap free SSL
I. Installation Requirements

1. Nginx has compiled the ssl module. If not, re-compile the module.
2. You have purchased an SSL Certificate (nonsense)

Ii. Start Installation

1. Mr. Cheng's own KEY

cd /usr/local/nginx/conf/openssl genrsa -out imcat.pem 2048

2. Generate the csr File

Openssl req-new-key imcat. pem-out imcat. csrCountry Name (2 letter code) [AU]: CN // enter the country abbreviation State or Province Name (full name) [Some-State]: JiangXi // Locality Name (eg, city) []: JiuJiang // city Organization Name (eg, company) [Internet Widgits Pty Ltd]: Yangxinlin // Organization Name or company Name Organizational Unit Name (eg, section) []: // you do not need to enter Common Name (eg, YOUR name) []: // enter the domain Name for ssl configuration, such as Note that ya and belong to different domain names. Email Address []: // enter your mailbox Please enter the following 'extra 'attributesto be sent with your certificate requestA challenge password []: // you do not need to enter An optional company name []: // you do not need to enter

3. Go to the Namecheap website to enable the SSL Certificate

Go to the Namecheap website and click Your ssl certificates under My Account in the SSL Certificates menu ,:

Select an SSL authentication service that you have never used and click the Active link on the right to apply for activating your SSL authentication. (If it has been enabled, you can issue a new issue and select Reissue. It will soon expire !)

Next, we will send an authentication signature request file to Namecheap to complete the activation process. If the Web server software does not have Nginx, only select other. Enter imcat In the csr below. the content of the csr, that is, the content that needs to be copied starting with ----- begin certificate request ----- to ----- end certificate request.

After pressing Next, you can now receive the email

It is best to submit the certificate directly, wait for the verification email to be received, and enter the verification code of the email to get the SSL certificate.

4. Extract the SSL certificate from NameCheap and upload it to/usr/local/nginx/conf/

5. then execute the following command to merge the certificate

cat imcat_in.crt>>PositiveSSLCA2.crtrm -rf imcat_in.crtmv PositiveSSLCA2.crt imcat_in.crt

6. Change Nginx Configuration

server{listen 443;server_name *;index index.PHP index.htm ;root /home/www/imcat/;ssl on;ssl_certificate imcat_in.crt;ssl_certificate_key imcat.pem;location / {try_files $uri $uri/ /index.php;location ~ .php$ {fastcgi_pass unix:/tmp/php-cgi.sock;fastcgi_index index.php;fastcgi_param HTTPS on;include fastcgi.conf;}}location ~ .*.(gif|jpg|jpeg|png|bmp|swf|js|css|ttf|woff)${expires 30d;}access_log /home/logs/;}

7. Restart nginx.

Related Article

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