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:
- 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
- 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
- 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)
- 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:
- The use of Nginx is not enough to understand, in some configuration and version updates do not understand
- Operation needs to be standardized, line operation ideas to clear, early start port, reference configuration file, etc., need a good ops sense
- 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.