Data collection-Upgrade Nginx server, add HTTPS process problems encountered

Source: Internet
Author: User
Tags nginx server ssl certificate
Data collection-Upgrade Nginx server, add HTTPS process problems encountered

tags (space delimited): Blog DevOps

Operation and maintenance students to help the server with SSL certificate, after modifying the Nginx conf file.

In the local test to send the data, the following JS code is placed under the browser execution
浏览器当前访问页面可以是www域,这样可以确保引用ajax执行

$.ajax({  '//xxx.com/api/collect',  'POST',  data: {    'tony--'  },  function(res){    console.log(res)  }})

After executing the HTTP status code 200, but to the server grep lookup did not find the corresponding information.

After a variety of search, not its fruit. Try to 测试打点环境spltest retry, everything is configured OK after the restart service, the browser side to switch the domain name re-test, on the test server does have the corresponding log generated.

Strange question, after some thinking basic locking should be environmental issues, so check the Nginx version.

On-line Nginx version:
Nginx version:nginx/1.0.15
Test Environment Version:
Nginx version:nginx/1.8.0

This time is not OK root cause, only the first attempt to upgrade the two nodes on the line nginx, fortunately there is a load balancer, you can easily switch (need to observe the traffic pressure during that period, to avoid the explosion caused by data loss)

Choose one of the installation 1.8.0 version of Nginx, because before the Yum installed, the path will be retained, Balabala ... There are also a lot of problems in this process:

  1. In earlier versions, such as Nginx/1.0.15,log_format defined in the server module, and in the version that we used Log_format defined in the HTTP module, incompatible
  2. When you copy the configuration file, the Include conf file is modified to the Conf file under the 1.8.0 version path, not the Yum version of/etc/nginx/conf.d/*.conf
  3. Log delimiter is ctl+a, operations operation when the direct copy is not possible, you need to manually enter (in the form of VIM open-insert mode-execute ctl+v-execution Ctl+a)
  4. Need to make sure 机器的https配置端口 it is open, open in the Qcloud interface, because this problem is killing ... And then I remembered.

Once configured, binding to the test domain test succeeds, and the line switches again and binds to the production load balancer.

Summary below:
The problem is not very big, but before and after the operation of two people 3 hours +, said it took a little time, reason:

  1. The use of Nginx is not enough to understand, in some configuration and version updates do not understand
  2. Operation needs to be standardized, line operation ideas to clear, early start port, reference configuration file, etc., need a good ops sense
  3. The consistency of the environment.

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the data collection-upgrade Nginx server, add HTTPS process encountered problems, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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