DNS server settings and nginx

First landing Ali cloud, select Control Panel, click the domain name


 
33.png

Then we can see the following interface, a set of domain name status is displayed as normal, click on the "resolve"


 
33.png

Into the "cloud resolution" screen, as follows:
 
33.png

Here, we first need to add a record, will be modified before adding the interface is as follows:


 
33.png

Then OK, we can enter the URL to access the web site, access to the interface is just finished deploying nginx page, as follows:
 
33.png

http: nginx needs in the installation directory conf / nginx.conf // access in this configuration:

 

 

After the domain name resolves to nginx, nginx is entering the initial default interface, and then we also need to enter in the configuration file nginx.conf nginx, do some configuration changes, as shown below:
 
112.png

 

So that we can have access to the port need to access. Another point to note:
 
115.png
This is the configuration file of the domain name commonConfig.js needs and above nginx.conf in the same domain.

https: // need access to Ali cloud in the purchase of SSL certificates Certificate Management Console (http hypertext transfer protocol, information is transmitted in the clear, https is encrypted with a security ssl transfer protocol)

 
13.png

 

 

After submitting the application needs to bind the domain name after the certificate purchase, wait for the issuance, the general will soon be issued, this certificate is valid for one year free
 
15.png

 

Download the file down after the issue of the two files
 
16.png

Nginx server install an SSL certificate:

In the Certificates console version download Nginx certificate. Downloaded to the local compressed file that contains the package and extract:
.crt files: a certificate file, crt is the extension pem file.
.key file: private key file certificates (application for a certificate If you do not choose to automatically create CSR, is not the file).
Tips: .pem extension of the certificate file in PEM format text file Base64-encoded, you can change the extension as required.

Nginx to the standard configuration, for example, if the certificate file name is a.pem, the private key file is a.key.

conf under Nginx installation directory create cert directory, and copy all the files downloaded to the cert directory. If the application for a certificate is CSR files you created, set the corresponding private key file into the directory and name under cert a.key;

Open the file nginx.conf Nginx installation directory conf directory, this configuration:

upstream   ctenant {
        server   127.0.0.1:9001; } server { listen 443; server_name ctenant.51cainiaojinfu.xyz; ssl on; root html; index index.html index.htm; ssl_certificate cert/1894526_ctenant.51cainiaojinfu.xyz.pem; ssl_certificate_key cert/1894526_ctenant.51cainiaojinfu.xyz.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { proxy_pass http://ctenant; client_max_body_size 100M; } } 

 

 

After save and exit and restart nginx, and then configure /opt/cash/server/cash-tenant-server/html/tenant/assets/common/commonConfig.js
 
25.png

Configuration commonConfig.js mainly to the front and rear ends of the splitter.
Then you can access the server using the domain name, we will be able to access the server just configured using the following URL in the form of black, when we enter the URL in the form of black find address is / opt / cash / server / cash -tenant-server / html / the following tenant / index.html this page.

https://ctenant.51cainiaojinfu.xyz/tenant/index.html

 

Guess you like

Origin www.cnblogs.com/YuyuanNo1/p/12524305.html