Data collection-problems encountered when upgrading the Nginx server and adding HTTPS

Source: Internet
Author: User
Tags nginx server
: This article mainly introduces the problems encountered during the process of data collection-upgrading the Nginx server and adding HTTPS. if you are interested in the PHP Tutorial, refer to it. Data collection-problems encountered when upgrading the Nginx server and adding HTTPS

Labels (separated by spaces): Blog DevOps

After adding an ssl certificate to the server, the O & M personnel can modify the nginx conf file.

Test and send data locally. put the following js code in the browser for execution.
The current webpage accessed by the browser can be a www domain, so that ajax can be referenced for execution.

$.ajax({  url: location.protocol + '//xxx.com/api/collect',  type: 'POST',  data: {    a: 'tony--'  },  success: function(res){    console.log(res)  }})

After Execution, the http status code 200 is returned, but no information is found on the grep server.

After various searches, the results are not acceptable. TryTest the hitting environment spltestRetry. after all configurations are OK, restart the service and re-test the domain name on the browser side. logs are generated on the test server.

This is a strange problem. after some thought, the basic locking should be an environmental problem, so I checked the nginx version ..

Online nginx version:
Nginx version: nginx/1.0.15
Test Environment version:
Nginx version: nginx/1.8.0

Root Cause cannot be determined at this time. only Nginx on the two online nodes can be upgraded first. Fortunately, there is a load balancer, which can be easily switched in this way (you need to observe the traffic pressure during that time period, avoid data loss caused by explosive growth)

Select one nginx with version 1.8.0 installed. because it was previously installed in yum, the path will be retained, balabala... There are many problems in this process:

  1. In earlier versions, for example, nginx/1.0.15 and log_format are defined in the server module. in our use, log_format is defined in the http module, which is incompatible.
  2. During configuration file copy, the include conf file is changed to the conf file in the path 1.8.0, instead of the/etc/nginx/conf. d/*. conf file in the yum version.
  3. The log delimiter is ctl + A. you cannot directly copy the log during O & M. you need to enter it manually (in the specific mode of vim enable-insert mode-execute ctl + V-execute ctl +)
  4. Make sure thatServer https configuration PortYes. it is opened on the qcloud interface, because this problem has crashed... Later I remembered

After configuration, the server load balancer instance is successfully bound to the test domain name, switched online again, and bound to the production server load balancer instance.

Summary:
The problem is not very big, but it takes a little time to operate two people three hours or more before and after the operation. The reason is:

  1. I am not familiar with nginx usage, but I am not familiar with some configuration and version updates.
  2. Operations need to be standardized, and the online operation ideas should be clear. open the port in advance, reference the configuration file, and so on, and a good ops sense is required.
  3. Environment consistency.

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The above introduces the problems encountered during the process of data collection-upgrading the Nginx server and adding HTTPS, including some content, and hope to help those who are interested in the PHP Tutorial.

    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.