由于ios的硬性要求,上架apstore的ios产品必须使用https协议和TLS1.2以上的版本协议。
https协议通过nginx侦听配置在这里。但由于配置完成后,默认http协议请求将进行ssl认证。考虑到安卓对https没有严格的要求,https和http协议在这里共存。server { listen 80 default backlog=2048; #如果硬性要求全部采用https协议,则该行将被删除 listen 443 ssl; #若硬性要求全部采用https协议,在这里去除ssl server_name domain.com; #ssl on; #若硬性要求全部采用https协议,在这里打开ssl on ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate_key /etc/nginx/ssl/server.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location ^~ /test/ { root html;index index.html index.htm; proxy_redirect off;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; send_timeout 40; proxy_connect_timeout 40; proxy_read_timeout 60; proxy_pass http://domain.com; client_max_body_size 100m; }}