Once iOS requires all requests to be HTTPS for security purposes, the HTTPS process is configured in the logging project.
# Generate an RSA key
OpenSSL genrsa-des3-out xgj.key
# Copy a key file that does not require a password to enter
OpenSSL rsa-in xgj.key-out xgj_nopass. Key
# Generate a certificate request
$ openssl req-new-key xgj.key-out XGJ.CSR
Create CA certificate:
OpenSSL req-new-x509-key Xgj.key-o UT ca.crt-days 3650
# Self-issued certificate
$ openssl x509-req-days 3650-in xgj.csr-signkey xgj.key-out xgj.crt
OpenSSL X509-req-days 3650-in xgj.csr-ca ca.crt-cakey xgj.key-cacreateserial-out xgj.crt
Configure the Nginx configuration certificate file in Nginx conf file
server {
listen default_server;
server_name localhost;
Access_log /data/logs/access.log main;
SSL on ;
Ssl_certificate /etc/nginx/conf.d/xgj.crt;
Ssl_certificate_key /etc/nginx/conf.d/xgj_nopass.key;
#ssl_client_certificate /etc/nginx/conf.d/ca.crt; #双向认证
#ssl_verify_client on; #双向认证
Location/api {proxy_pass http://127.0.0.1:189; Proxy_set_header x-real-ip $remote _addr; proxy_set_header X-forwarded-for $proxy _add_x_forwarded_for; }}