Create an HTTPS certificate

Source: Internet
Author: User

First milestone: Create an HTTPS certificate

Create a File authentication directory

mkdir/application/nginx/key/-P

Create an authentication file under the authentication directory

  1. OpenSSL req-new -x509-nodes- out Server.crt-keyout Server.key
  2. ?
  3. Generating a 2048 bit RSA private key
  4. .......+++
  5. ......................................+++
  6. Writing newprivate key to ' Server.key '
  7. -----
  8. You is about-to is asked to-enter information that'll be incorporated
  9. into your certificate request.
  10. What's about-to- Enter is called a distinguished Name or a DN.
  11. There is quite a few fields but can leave some blank
  12. For some fields there would be a defaultvalue,
  13. If you enter '. ', the field would be a left blank.
  14. -----
  15. Country Name (2 letter code) [Xx]:ch
  16. State or province name (full name) []:BJ
  17. Locality Name (eg, city) [Default CITY]:BJ
  18. Organization Name (eg, company) [Default company LTD]: Enter
  19. Organizational Unit Name (eg, section) []: Enter
  20. Common name (eg, your name or your server ' s hostname) []: Enter
  21. Email Address []: Enter

Write Nginx configuration file (configured on load balancer)

  1. Worker_processes 1;
  2. Events {
  3. ???? Worker_connections 1024;
  4. }
  5. HTTP {
  6. ???? Include Mime.types;
  7. ???? Default_type Application/octet-stream;
  8. ???? Sendfile on;
  9. ???? Keepalive_timeout 65;
  10. ???? Upstream Www_pools {
  11. ?????? Server 10.0.0.8;
  12. ???}
  13. ???? Upstream Bbs_pools {
  14. ?????? Server 10.0.0.7;
  15. ???}
  16. ???? Upstream Blog_pools {
  17. ?????? Server 10.0.0.9;
  18. ????}
  19. ???? server {
  20. ???????? Listen 443 SSL;
  21. ???????? Listen 80;
  22. ???????? server_name www.etiantian.org;
  23. ???????? SSL_CERTIFICATE/APPLICATION/NGINX/KEY/SERVER.CRT;
  24. ???????? Ssl_certificate_key/application/nginx/key/server.key;
  25. ???????? Ssl_session_cache shared:ssl:1m;
  26. ???????? Ssl_session_timeout 5m;
  27. ???????? Ssl_ciphers high:!anull:! MD5;
  28. ???????? Ssl_prefer_server_ciphers on;
  29. ???????? Location/{
  30. ???????????? Proxy_pass http://www_pools;
  31. ???????????? Proxy_set_header Host $host;
  32. ???????????? Proxy_set_header x-forwarded-for $remote _addr;
  33. ????????}
  34. ????}
  35. ???? server {
  36. ???????? Listen 80;
  37. ???????????? server_name bbs.etiantian.org;
  38. ???????? Location/{
  39. ???????????? Proxy_pass http://bbs_pools;
  40. ???????????? Proxy_set_header Host $host;
  41. ???????????? Proxy_set_header x-forwarded-for $remote _addr;
  42. ????????}
  43. ????}
  44. ???????? server {
  45. ???????? Listen 80;
  46. ???????????? server_name c.etiantian.org;
  47. ???????? Location/{
  48. ???????????? Proxy_pass http://bbs_pools;
  49. ???????????? Proxy_set_header Host $host;
  50. ???????????? Proxy_set_header x-forwarded-for $remote _addr;
  51. ????????}
  52. ????}
  53. ?
  54. ???? server {
  55. ???????? Listen 80;
  56. ???????????? server_name blog.etiantian.org;
  57. ???????? Location/{
  58. ???????????? Proxy_pass http://blog_pools;
  59. ???????????? Proxy_set_header Host $host;
  60. ???????????? Proxy_set_header x-forwarded-for $remote _addr;
  61. ????????}
  62. ????}
  63. }

Test

Create an HTTPS certificate

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.