×

Nginx Web负载均衡开局配置
  

justgonnab 3655

{{ttag.title}}
本帖最后由 justgonnab 于 2018-11-29 10:46 编辑

可能做过Web集群的小伙伴都对nginx不陌生了,它既可以做web服务器也可以反向代理做web集群(负载均衡),而且之前的文章我更多地介绍是关于TCP/IP网络或者FC网络的链路负载均衡,在TCP/IP模型中,可能是基于三层或三层以下所考虑的负载均衡方式。而web负载均衡在某公司的产品线中也有实现此类功能的硬件设备叫做AD(应用交付)。在一般的业务环境中实测硬件的负载均衡功能种类多、性能强,其包含了链路负载均衡、服务器负载均衡等,还有各种负载的方式,并且基于图形化的界面和自动脚本,可以为用户提供高效、便捷的IT优化服务。而软件厂商更偏向于使用低成本甚至免费的软件负载均衡。这次介绍较为常用的nginx。


nginx的部署环境建议使用Linux环境以便后期使用更多高级的扩展功能模块,如果为了简单便捷也可以使用Windows版本。这两种版本的nginx安装方式不一样,但配置文件配置方法一致。


测试环境:Red Hat Enterprise Linux Server release 6.5 (Santiago)
需要准备的文件:CentOS-6.5-x86_64-bin-DVD1.iso、nginx-1.14.1.tar.gz


首先在安装部署nginx之前需要安装必备的组件:zlib、pcre、openssl。
在离线环境下挂载系统默认的镜像CentOS-6.5-x86_64-bin-DVD1.iso:

  1. [root@localhost ~]# mount /dev/sr0 /mnt/
  2. mount: block device /dev/sr0 is write-protected, mounting read-only
复制代码

挂载成功后,配置yum源:

  1. [root@localhost ~]# cd /etc/yum.repos.d/
  2. [root@localhost yum.repos.d]# touch myyum.repo
  3. [root@localhost yum.repos.d]# vim myyum.repo
复制代码

输入如下内容:


  1. [myyum]

  2. name=myyum is test

  3. baseurl=file:///mnt/Server

  4. enabled=1

  5. gpgcheck=0
复制代码

然后保存并退出。


生成yum缓存:


  1. [root@localhost yum.repos.d]# yum makecache
  2. Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
  3. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  4. myyum                                                                                                                                 | 3.9 kB     00:00 ...
  5. Metadata Cache Created
复制代码

yum安装组件(由于之前测试装过了zlib和pcre,所以这里只安装了openssl):


  1. [root@localhost yum.repos.d]# yum install -y zlib* pcre* openssl*
  2. Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
  3. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  4. Setting up Install Process
  5. Package zlib-devel-1.2.3-29.el6.x86_64 already installed and latest version
  6. Package zlib-1.2.3-29.el6.x86_64 already installed and latest version
  7. Package pcre-7.8-6.el6.x86_64 already installed and latest version
  8. Package pcre-devel-7.8-6.el6.x86_64 already installed and latest version
  9. Package openssl-1.0.1e-15.el6.x86_64 already installed and latest version
  10. Package openssl-devel-1.0.1e-15.el6.x86_64 already installed and latest version
  11. Resolving Dependencies
  12. --> Running transaction check
  13. ---> Package openssl098e.x86_64 0:0.9.8e-17.el6_2.2 will be installed
  14. --> Finished Dependency Resolution

  15. Dependencies Resolved

  16. =============================================================================================================================================================
  17. Package                               Arch                             Version                                        Repository                       Size
  18. =============================================================================================================================================================
  19. Installing:
  20. openssl098e                           x86_64                           0.9.8e-17.el6_2.2                              myyum                           761 k

  21. Transaction Summary
  22. =============================================================================================================================================================
  23. Install       1 Package(s)

  24. Total download size: 761 k
  25. Installed size: 2.2 M
  26. Downloading Packages:
  27. Running rpm_check_debug
  28. Running Transaction Test
  29. Transaction Test Succeeded
  30. Running Transaction
  31.   Installing : openssl098e-0.9.8e-17.el6_2.2.x86_64                                                                                                      1/1
  32.   Verifying  : openssl098e-0.9.8e-17.el6_2.2.x86_64                                                                                                      1/1

  33. Installed:
  34.   openssl098e.x86_64 0:0.9.8e-17.el6_2.2                                                                                                                     

  35. Complete!
复制代码

安装完成之后,解压nginx-1.14.1.tar.gz进行编译安装:


  1. [root@localhost home]# tar -zxvf nginx-1.14.1.tar.gz
  2. nginx-1.14.1/
  3. nginx-1.14.1/auto/
  4. nginx-1.14.1/conf/
  5. nginx-1.14.1/contrib/
  6. nginx-1.14.1/src/
  7. nginx-1.14.1/configure
  8. nginx-1.14.1/LICENSE
  9. nginx-1.14.1/README
  10. nginx-1.14.1/html/
  11. nginx-1.14.1/man/
  12. nginx-1.14.1/CHANGES.ru
  13. nginx-1.14.1/CHANGES
  14. nginx-1.14.1/man/nginx.8
  15. nginx-1.14.1/html/50x.html
  16. nginx-1.14.1/html/index.html
  17. nginx-1.14.1/src/core/
  18. nginx-1.14.1/src/event/
  19. nginx-1.14.1/src/http/
  20. nginx-1.14.1/src/mail/
  21. nginx-1.14.1/src/misc/
  22. nginx-1.14.1/src/os/
  23. nginx-1.14.1/src/stream/
  24. nginx-1.14.1/src/stream/ngx_stream.c
  25. nginx-1.14.1/src/stream/ngx_stream.h
  26. nginx-1.14.1/src/stream/ngx_stream_access_module.c
  27. nginx-1.14.1/src/stream/ngx_stream_core_module.c
  28. nginx-1.14.1/src/stream/ngx_stream_geo_module.c
  29. nginx-1.14.1/src/stream/ngx_stream_geoip_module.c
  30. nginx-1.14.1/src/stream/ngx_stream_handler.c
  31. nginx-1.14.1/src/stream/ngx_stream_limit_conn_module.c
  32. nginx-1.14.1/src/stream/ngx_stream_log_module.c
  33. nginx-1.14.1/src/stream/ngx_stream_map_module.c
  34. nginx-1.14.1/src/stream/ngx_stream_proxy_module.c
  35. nginx-1.14.1/src/stream/ngx_stream_realip_module.c
  36. nginx-1.14.1/src/stream/ngx_stream_return_module.c
  37. nginx-1.14.1/src/stream/ngx_stream_script.c
  38. nginx-1.14.1/src/stream/ngx_stream_script.h
  39. nginx-1.14.1/src/stream/ngx_stream_split_clients_module.c
  40. nginx-1.14.1/src/stream/ngx_stream_ssl_module.c
  41. nginx-1.14.1/src/stream/ngx_stream_ssl_module.h
  42. nginx-1.14.1/src/stream/ngx_stream_ssl_preread_module.c
  43. nginx-1.14.1/src/stream/ngx_stream_upstream.c
  44. nginx-1.14.1/src/stream/ngx_stream_upstream.h
  45. nginx-1.14.1/src/stream/ngx_stream_upstream_hash_module.c
  46. nginx-1.14.1/src/stream/ngx_stream_upstream_least_conn_module.c
  47. nginx-1.14.1/src/stream/ngx_stream_upstream_round_robin.c
  48. nginx-1.14.1/src/stream/ngx_stream_upstream_round_robin.h
  49. nginx-1.14.1/src/stream/ngx_stream_upstream_zone_module.c
  50. nginx-1.14.1/src/stream/ngx_stream_variables.c
  51. nginx-1.14.1/src/stream/ngx_stream_variables.h
  52. nginx-1.14.1/src/stream/ngx_stream_write_filter_module.c
  53. nginx-1.14.1/src/os/unix/
  54. nginx-1.14.1/src/os/unix/ngx_alloc.c
  55. nginx-1.14.1/src/os/unix/ngx_alloc.h
  56. nginx-1.14.1/src/os/unix/ngx_atomic.h
  57. nginx-1.14.1/src/os/unix/ngx_channel.c
  58. nginx-1.14.1/src/os/unix/ngx_channel.h
  59. nginx-1.14.1/src/os/unix/ngx_daemon.c
  60. nginx-1.14.1/src/os/unix/ngx_darwin.h
  61. nginx-1.14.1/src/os/unix/ngx_darwin_config.h
  62. nginx-1.14.1/src/os/unix/ngx_darwin_init.c
  63. nginx-1.14.1/src/os/unix/ngx_darwin_sendfile_chain.c
  64. nginx-1.14.1/src/os/unix/ngx_dlopen.c
  65. nginx-1.14.1/src/os/unix/ngx_dlopen.h
  66. nginx-1.14.1/src/os/unix/ngx_errno.c
  67. nginx-1.14.1/src/os/unix/ngx_errno.h
  68. nginx-1.14.1/src/os/unix/ngx_file_aio_read.c
  69. nginx-1.14.1/src/os/unix/ngx_files.c
  70. nginx-1.14.1/src/os/unix/ngx_files.h
  71. nginx-1.14.1/src/os/unix/ngx_freebsd.h
  72. nginx-1.14.1/src/os/unix/ngx_freebsd_config.h
  73. nginx-1.14.1/src/os/unix/ngx_linux.h
  74. nginx-1.14.1/src/os/unix/ngx_freebsd_init.c
  75. nginx-1.14.1/src/os/unix/ngx_freebsd_sendfile_chain.c
  76. nginx-1.14.1/src/os/unix/ngx_gcc_atomic_amd64.h
  77. nginx-1.14.1/src/os/unix/ngx_gcc_atomic_ppc.h
  78. nginx-1.14.1/src/os/unix/ngx_gcc_atomic_sparc64.h
  79. nginx-1.14.1/src/os/unix/ngx_gcc_atomic_x86.h
  80. nginx-1.14.1/src/os/unix/ngx_linux_aio_read.c
  81. nginx-1.14.1/src/os/unix/ngx_linux_config.h
  82. nginx-1.14.1/src/os/unix/ngx_linux_init.c
  83. nginx-1.14.1/src/os/unix/ngx_linux_sendfile_chain.c
  84. nginx-1.14.1/src/os/unix/ngx_os.h
  85. nginx-1.14.1/src/os/unix/ngx_posix_config.h
  86. nginx-1.14.1/src/os/unix/ngx_posix_init.c
  87. nginx-1.14.1/src/os/unix/ngx_process.c
  88. nginx-1.14.1/src/os/unix/ngx_process.h
  89. nginx-1.14.1/src/os/unix/ngx_process_cycle.c
  90. nginx-1.14.1/src/os/unix/ngx_process_cycle.h
  91. nginx-1.14.1/src/os/unix/ngx_readv_chain.c
  92. nginx-1.14.1/src/os/unix/ngx_recv.c
  93. nginx-1.14.1/src/os/unix/ngx_send.c
  94. nginx-1.14.1/src/os/unix/ngx_setaffinity.c
  95. nginx-1.14.1/src/os/unix/ngx_setaffinity.h
  96. nginx-1.14.1/src/os/unix/ngx_setproctitle.c
  97. nginx-1.14.1/src/os/unix/ngx_setproctitle.h
  98. nginx-1.14.1/src/os/unix/ngx_shmem.c
  99. nginx-1.14.1/src/os/unix/ngx_shmem.h
  100. nginx-1.14.1/src/os/unix/ngx_socket.c
  101. nginx-1.14.1/src/os/unix/ngx_socket.h
  102. nginx-1.14.1/src/os/unix/ngx_solaris.h
  103. nginx-1.14.1/src/os/unix/ngx_solaris_config.h
  104. nginx-1.14.1/src/os/unix/ngx_solaris_init.c
  105. nginx-1.14.1/src/os/unix/ngx_solaris_sendfilev_chain.c
  106. nginx-1.14.1/src/os/unix/ngx_sunpro_amd64.il
  107. nginx-1.14.1/src/os/unix/ngx_sunpro_atomic_sparc64.h
  108. nginx-1.14.1/src/os/unix/ngx_sunpro_sparc64.il
  109. nginx-1.14.1/src/os/unix/ngx_thread.h
  110. nginx-1.14.1/src/os/unix/ngx_sunpro_x86.il
  111. nginx-1.14.1/src/os/unix/ngx_thread_cond.c
  112. nginx-1.14.1/src/os/unix/ngx_thread_id.c
  113. nginx-1.14.1/src/os/unix/ngx_thread_mutex.c
  114. nginx-1.14.1/src/os/unix/ngx_time.c
  115. nginx-1.14.1/src/os/unix/ngx_time.h
  116. nginx-1.14.1/src/os/unix/ngx_udp_recv.c
  117. nginx-1.14.1/src/os/unix/ngx_udp_send.c
  118. nginx-1.14.1/src/os/unix/ngx_udp_sendmsg_chain.c
  119. nginx-1.14.1/src/os/unix/ngx_user.c
  120. nginx-1.14.1/src/os/unix/ngx_user.h
  121. nginx-1.14.1/src/os/unix/ngx_writev_chain.c
  122. nginx-1.14.1/src/misc/ngx_cpp_test_module.cpp
  123. nginx-1.14.1/src/misc/ngx_google_perftools_module.c
  124. nginx-1.14.1/src/mail/ngx_mail.c
  125. nginx-1.14.1/src/mail/ngx_mail.h
  126. nginx-1.14.1/src/mail/ngx_mail_auth_http_module.c
  127. nginx-1.14.1/src/mail/ngx_mail_core_module.c
  128. nginx-1.14.1/src/mail/ngx_mail_handler.c
  129. nginx-1.14.1/src/mail/ngx_mail_imap_handler.c
  130. nginx-1.14.1/src/mail/ngx_mail_imap_module.c
  131. nginx-1.14.1/src/mail/ngx_mail_imap_module.h
  132. nginx-1.14.1/src/mail/ngx_mail_parse.c
  133. nginx-1.14.1/src/mail/ngx_mail_pop3_handler.c
  134. nginx-1.14.1/src/mail/ngx_mail_pop3_module.c
  135. nginx-1.14.1/src/mail/ngx_mail_pop3_module.h
  136. nginx-1.14.1/src/mail/ngx_mail_proxy_module.c
  137. nginx-1.14.1/src/mail/ngx_mail_smtp_handler.c
  138. nginx-1.14.1/src/mail/ngx_mail_smtp_module.c
  139. nginx-1.14.1/src/mail/ngx_mail_smtp_module.h
  140. nginx-1.14.1/src/mail/ngx_mail_ssl_module.c
  141. nginx-1.14.1/src/mail/ngx_mail_ssl_module.h
  142. nginx-1.14.1/src/http/modules/
  143. nginx-1.14.1/src/http/ngx_http.c
  144. nginx-1.14.1/src/http/ngx_http.h
  145. nginx-1.14.1/src/http/ngx_http_cache.h
  146. nginx-1.14.1/src/http/ngx_http_config.h
  147. nginx-1.14.1/src/http/ngx_http_copy_filter_module.c
  148. nginx-1.14.1/src/http/ngx_http_core_module.c
  149. nginx-1.14.1/src/http/ngx_http_core_module.h
  150. nginx-1.14.1/src/http/ngx_http_file_cache.c
  151. nginx-1.14.1/src/http/ngx_http_header_filter_module.c
  152. nginx-1.14.1/src/http/ngx_http_parse.c
  153. nginx-1.14.1/src/http/ngx_http_postpone_filter_module.c
  154. nginx-1.14.1/src/http/ngx_http_request.c
  155. nginx-1.14.1/src/http/ngx_http_request.h
  156. nginx-1.14.1/src/http/ngx_http_request_body.c
  157. nginx-1.14.1/src/http/ngx_http_script.c
  158. nginx-1.14.1/src/http/v2/
  159. nginx-1.14.1/src/http/ngx_http_script.h
  160. nginx-1.14.1/src/http/ngx_http_special_response.c
  161. nginx-1.14.1/src/http/ngx_http_upstream.c
  162. nginx-1.14.1/src/http/ngx_http_upstream.h
  163. nginx-1.14.1/src/http/ngx_http_upstream_round_robin.c
  164. nginx-1.14.1/src/http/ngx_http_upstream_round_robin.h
  165. nginx-1.14.1/src/http/ngx_http_variables.c
  166. nginx-1.14.1/src/http/ngx_http_variables.h
  167. nginx-1.14.1/src/http/ngx_http_write_filter_module.c
  168. nginx-1.14.1/src/http/v2/ngx_http_v2.c
  169. nginx-1.14.1/src/http/v2/ngx_http_v2.h
  170. nginx-1.14.1/src/http/v2/ngx_http_v2_encode.c
  171. nginx-1.14.1/src/http/v2/ngx_http_v2_filter_module.c
  172. nginx-1.14.1/src/http/v2/ngx_http_v2_huff_decode.c
  173. nginx-1.14.1/src/http/v2/ngx_http_v2_huff_encode.c
  174. nginx-1.14.1/src/http/v2/ngx_http_v2_module.c
  175. nginx-1.14.1/src/http/v2/ngx_http_v2_module.h
  176. nginx-1.14.1/src/http/v2/ngx_http_v2_table.c
  177. nginx-1.14.1/src/http/modules/ngx_http_access_module.c
  178. nginx-1.14.1/src/http/modules/ngx_http_addition_filter_module.c
  179. nginx-1.14.1/src/http/modules/ngx_http_auth_basic_module.c
  180. nginx-1.14.1/src/http/modules/ngx_http_auth_request_module.c
  181. nginx-1.14.1/src/http/modules/ngx_http_autoindex_module.c
  182. nginx-1.14.1/src/http/modules/ngx_http_browser_module.c
  183. nginx-1.14.1/src/http/modules/ngx_http_charset_filter_module.c
  184. nginx-1.14.1/src/http/modules/ngx_http_chunked_filter_module.c
  185. nginx-1.14.1/src/http/modules/ngx_http_dav_module.c
  186. nginx-1.14.1/src/http/modules/ngx_http_degradation_module.c
  187. nginx-1.14.1/src/http/modules/ngx_http_empty_gif_module.c
  188. nginx-1.14.1/src/http/modules/ngx_http_fastcgi_module.c
  189. nginx-1.14.1/src/http/modules/perl/
  190. nginx-1.14.1/src/http/modules/ngx_http_flv_module.c
  191. nginx-1.14.1/src/http/modules/ngx_http_geo_module.c
  192. nginx-1.14.1/src/http/modules/ngx_http_geoip_module.c
  193. nginx-1.14.1/src/http/modules/ngx_http_grpc_module.c
  194. nginx-1.14.1/src/http/modules/ngx_http_gunzip_filter_module.c
  195. nginx-1.14.1/src/http/modules/ngx_http_gzip_filter_module.c
  196. nginx-1.14.1/src/http/modules/ngx_http_gzip_static_module.c
  197. nginx-1.14.1/src/http/modules/ngx_http_headers_filter_module.c
  198. nginx-1.14.1/src/http/modules/ngx_http_image_filter_module.c
  199. nginx-1.14.1/src/http/modules/ngx_http_index_module.c
  200. nginx-1.14.1/src/http/modules/ngx_http_limit_conn_module.c
  201. nginx-1.14.1/src/http/modules/ngx_http_limit_req_module.c
  202. nginx-1.14.1/src/http/modules/ngx_http_log_module.c
  203. nginx-1.14.1/src/http/modules/ngx_http_map_module.c
  204. nginx-1.14.1/src/http/modules/ngx_http_memcached_module.c
  205. nginx-1.14.1/src/http/modules/ngx_http_mirror_module.c
  206. nginx-1.14.1/src/http/modules/ngx_http_mp4_module.c
  207. nginx-1.14.1/src/http/modules/ngx_http_not_modified_filter_module.c
  208. nginx-1.14.1/src/http/modules/ngx_http_proxy_module.c
  209. nginx-1.14.1/src/http/modules/ngx_http_random_index_module.c
  210. nginx-1.14.1/src/http/modules/ngx_http_range_filter_module.c
  211. nginx-1.14.1/src/http/modules/ngx_http_realip_module.c
  212. nginx-1.14.1/src/http/modules/ngx_http_referer_module.c
  213. nginx-1.14.1/src/http/modules/ngx_http_rewrite_module.c
  214. nginx-1.14.1/src/http/modules/ngx_http_scgi_module.c
  215. nginx-1.14.1/src/http/modules/ngx_http_secure_link_module.c
  216. nginx-1.14.1/src/http/modules/ngx_http_slice_filter_module.c
  217. nginx-1.14.1/src/http/modules/ngx_http_split_clients_module.c
  218. nginx-1.14.1/src/http/modules/ngx_http_ssi_filter_module.c
  219. nginx-1.14.1/src/http/modules/ngx_http_ssi_filter_module.h
  220. nginx-1.14.1/src/http/modules/ngx_http_ssl_module.c
  221. nginx-1.14.1/src/http/modules/ngx_http_ssl_module.h
  222. nginx-1.14.1/src/http/modules/ngx_http_static_module.c
  223. nginx-1.14.1/src/http/modules/ngx_http_stub_status_module.c
  224. nginx-1.14.1/src/http/modules/ngx_http_sub_filter_module.c
  225. nginx-1.14.1/src/http/modules/ngx_http_try_files_module.c
  226. nginx-1.14.1/src/http/modules/ngx_http_upstream_hash_module.c
  227. nginx-1.14.1/src/http/modules/ngx_http_upstream_ip_hash_module.c
  228. nginx-1.14.1/src/http/modules/ngx_http_upstream_keepalive_module.c
  229. nginx-1.14.1/src/http/modules/ngx_http_upstream_zone_module.c
  230. nginx-1.14.1/src/http/modules/ngx_http_upstream_least_conn_module.c
  231. nginx-1.14.1/src/http/modules/ngx_http_userid_filter_module.c
  232. nginx-1.14.1/src/http/modules/ngx_http_uwsgi_module.c
  233. nginx-1.14.1/src/http/modules/ngx_http_xslt_filter_module.c
  234. nginx-1.14.1/src/http/modules/perl/Makefile.PL
  235. nginx-1.14.1/src/http/modules/perl/nginx.pm
  236. nginx-1.14.1/src/http/modules/perl/nginx.xs
  237. nginx-1.14.1/src/http/modules/perl/ngx_http_perl_module.c
  238. nginx-1.14.1/src/http/modules/perl/ngx_http_perl_module.h
  239. nginx-1.14.1/src/http/modules/perl/typemap
  240. nginx-1.14.1/src/event/modules/
  241. nginx-1.14.1/src/event/ngx_event.c
  242. nginx-1.14.1/src/event/ngx_event.h
  243. nginx-1.14.1/src/event/ngx_event_accept.c
  244. nginx-1.14.1/src/event/ngx_event_connect.c
  245. nginx-1.14.1/src/event/ngx_event_connect.h
  246. nginx-1.14.1/src/event/ngx_event_openssl.c
  247. nginx-1.14.1/src/event/ngx_event_openssl.h
  248. nginx-1.14.1/src/event/ngx_event_openssl_stapling.c
  249. nginx-1.14.1/src/event/ngx_event_pipe.c
  250. nginx-1.14.1/src/event/ngx_event_pipe.h
  251. nginx-1.14.1/src/event/ngx_event_posted.c
  252. nginx-1.14.1/src/event/ngx_event_posted.h
  253. nginx-1.14.1/src/event/ngx_event_timer.c
  254. nginx-1.14.1/src/event/ngx_event_timer.h
  255. nginx-1.14.1/src/event/modules/ngx_devpoll_module.c
  256. nginx-1.14.1/src/event/modules/ngx_epoll_module.c
  257. nginx-1.14.1/src/event/modules/ngx_eventport_module.c
  258. nginx-1.14.1/src/event/modules/ngx_kqueue_module.c
  259. nginx-1.14.1/src/event/modules/ngx_poll_module.c
  260. nginx-1.14.1/src/event/modules/ngx_select_module.c
  261. nginx-1.14.1/src/event/modules/ngx_win32_select_module.c
  262. nginx-1.14.1/src/core/nginx.c
  263. nginx-1.14.1/src/core/nginx.h
  264. nginx-1.14.1/src/core/ngx_array.c
  265. nginx-1.14.1/src/core/ngx_array.h
  266. nginx-1.14.1/src/core/ngx_buf.c
  267. nginx-1.14.1/src/core/ngx_buf.h
  268. nginx-1.14.1/src/core/ngx_conf_file.c
  269. nginx-1.14.1/src/core/ngx_conf_file.h
  270. nginx-1.14.1/src/core/ngx_config.h
  271. nginx-1.14.1/src/core/ngx_connection.c
  272. nginx-1.14.1/src/core/ngx_connection.h
  273. nginx-1.14.1/src/core/ngx_core.h
  274. nginx-1.14.1/src/core/ngx_cpuinfo.c
  275. nginx-1.14.1/src/core/ngx_crc.h
  276. nginx-1.14.1/src/core/ngx_crc32.c
  277. nginx-1.14.1/src/core/ngx_crc32.h
  278. nginx-1.14.1/src/core/ngx_crypt.c
  279. nginx-1.14.1/src/core/ngx_crypt.h
  280. nginx-1.14.1/src/core/ngx_cycle.c
  281. nginx-1.14.1/src/core/ngx_cycle.h
  282. nginx-1.14.1/src/core/ngx_file.c
  283. nginx-1.14.1/src/core/ngx_file.h
  284. nginx-1.14.1/src/core/ngx_hash.c
  285. nginx-1.14.1/src/core/ngx_hash.h
  286. nginx-1.14.1/src/core/ngx_inet.c
  287. nginx-1.14.1/src/core/ngx_inet.h
  288. nginx-1.14.1/src/core/ngx_list.c
  289. nginx-1.14.1/src/core/ngx_list.h
  290. nginx-1.14.1/src/core/ngx_log.c
  291. nginx-1.14.1/src/core/ngx_log.h
  292. nginx-1.14.1/src/core/ngx_md5.c
  293. nginx-1.14.1/src/core/ngx_md5.h
  294. nginx-1.14.1/src/core/ngx_module.c
  295. nginx-1.14.1/src/core/ngx_module.h
  296. nginx-1.14.1/src/core/ngx_murmurhash.c
  297. nginx-1.14.1/src/core/ngx_murmurhash.h
  298. nginx-1.14.1/src/core/ngx_open_file_cache.c
  299. nginx-1.14.1/src/core/ngx_open_file_cache.h
  300. nginx-1.14.1/src/core/ngx_output_chain.c
  301. nginx-1.14.1/src/core/ngx_palloc.c
  302. nginx-1.14.1/src/core/ngx_palloc.h
  303. nginx-1.14.1/src/core/ngx_parse.c
  304. nginx-1.14.1/src/core/ngx_parse.h
  305. nginx-1.14.1/src/core/ngx_parse_time.c
  306. nginx-1.14.1/src/core/ngx_queue.c
  307. nginx-1.14.1/src/core/ngx_parse_time.h
  308. nginx-1.14.1/src/core/ngx_proxy_protocol.c
  309. nginx-1.14.1/src/core/ngx_proxy_protocol.h
  310. nginx-1.14.1/src/core/ngx_queue.h
  311. nginx-1.14.1/src/core/ngx_radix_tree.c
  312. nginx-1.14.1/src/core/ngx_radix_tree.h
  313. nginx-1.14.1/src/core/ngx_rbtree.c
  314. nginx-1.14.1/src/core/ngx_rbtree.h
  315. nginx-1.14.1/src/core/ngx_regex.c
  316. nginx-1.14.1/src/core/ngx_regex.h
  317. nginx-1.14.1/src/core/ngx_resolver.c
  318. nginx-1.14.1/src/core/ngx_resolver.h
  319. nginx-1.14.1/src/core/ngx_rwlock.c
  320. nginx-1.14.1/src/core/ngx_rwlock.h
  321. nginx-1.14.1/src/core/ngx_sha1.c
  322. nginx-1.14.1/src/core/ngx_sha1.h
  323. nginx-1.14.1/src/core/ngx_shmtx.c
  324. nginx-1.14.1/src/core/ngx_shmtx.h
  325. nginx-1.14.1/src/core/ngx_slab.c
  326. nginx-1.14.1/src/core/ngx_slab.h
  327. nginx-1.14.1/src/core/ngx_spinlock.c
  328. nginx-1.14.1/src/core/ngx_string.c
  329. nginx-1.14.1/src/core/ngx_string.h
  330. nginx-1.14.1/src/core/ngx_syslog.c
  331. nginx-1.14.1/src/core/ngx_syslog.h
  332. nginx-1.14.1/src/core/ngx_thread_pool.c
  333. nginx-1.14.1/src/core/ngx_thread_pool.h
  334. nginx-1.14.1/src/core/ngx_times.c
  335. nginx-1.14.1/src/core/ngx_times.h
  336. nginx-1.14.1/contrib/README
  337. nginx-1.14.1/contrib/geo2nginx.pl
  338. nginx-1.14.1/contrib/unicode2nginx/
  339. nginx-1.14.1/contrib/vim/
  340. nginx-1.14.1/contrib/vim/ftdetect/
  341. nginx-1.14.1/contrib/vim/ftplugin/
  342. nginx-1.14.1/contrib/vim/indent/
  343. nginx-1.14.1/contrib/vim/syntax/
  344. nginx-1.14.1/contrib/vim/syntax/nginx.vim
  345. nginx-1.14.1/contrib/vim/indent/nginx.vim
  346. nginx-1.14.1/contrib/vim/ftplugin/nginx.vim
  347. nginx-1.14.1/contrib/vim/ftdetect/nginx.vim
  348. nginx-1.14.1/contrib/unicode2nginx/koi-utf
  349. nginx-1.14.1/contrib/unicode2nginx/unicode-to-nginx.pl
  350. nginx-1.14.1/contrib/unicode2nginx/win-utf
  351. nginx-1.14.1/conf/fastcgi.conf
  352. nginx-1.14.1/conf/fastcgi_params
  353. nginx-1.14.1/conf/koi-utf
  354. nginx-1.14.1/conf/koi-win
  355. nginx-1.14.1/conf/mime.types
  356. nginx-1.14.1/conf/nginx.conf
  357. nginx-1.14.1/conf/scgi_params
  358. nginx-1.14.1/conf/uwsgi_params
  359. nginx-1.14.1/conf/win-utf
  360. nginx-1.14.1/auto/cc/
  361. nginx-1.14.1/auto/define
  362. nginx-1.14.1/auto/endianness
  363. nginx-1.14.1/auto/feature
  364. nginx-1.14.1/auto/have
  365. nginx-1.14.1/auto/have_headers
  366. nginx-1.14.1/auto/headers
  367. nginx-1.14.1/auto/include
  368. nginx-1.14.1/auto/init
  369. nginx-1.14.1/auto/install
  370. nginx-1.14.1/auto/lib/
  371. nginx-1.14.1/auto/make
  372. nginx-1.14.1/auto/module
  373. nginx-1.14.1/auto/modules
  374. nginx-1.14.1/auto/nohave
  375. nginx-1.14.1/auto/options
  376. nginx-1.14.1/auto/os/
  377. nginx-1.14.1/auto/sources
  378. nginx-1.14.1/auto/stubs
  379. nginx-1.14.1/auto/summary
  380. nginx-1.14.1/auto/threads
  381. nginx-1.14.1/auto/types/
  382. nginx-1.14.1/auto/unix
  383. nginx-1.14.1/auto/types/sizeof
  384. nginx-1.14.1/auto/types/typedef
  385. nginx-1.14.1/auto/types/uintptr_t
  386. nginx-1.14.1/auto/types/value
  387. nginx-1.14.1/auto/os/conf
  388. nginx-1.14.1/auto/os/darwin
  389. nginx-1.14.1/auto/os/freebsd
  390. nginx-1.14.1/auto/os/linux
  391. nginx-1.14.1/auto/os/solaris
  392. nginx-1.14.1/auto/os/win32
  393. nginx-1.14.1/auto/lib/conf
  394. nginx-1.14.1/auto/lib/geoip/
  395. nginx-1.14.1/auto/lib/google-perftools/
  396. nginx-1.14.1/auto/lib/libatomic/
  397. nginx-1.14.1/auto/lib/libgd/
  398. nginx-1.14.1/auto/lib/libxslt/
  399. nginx-1.14.1/auto/lib/make
  400. nginx-1.14.1/auto/lib/openssl/
  401. nginx-1.14.1/auto/lib/pcre/
  402. nginx-1.14.1/auto/lib/perl/
  403. nginx-1.14.1/auto/lib/zlib/
  404. nginx-1.14.1/auto/lib/zlib/conf
  405. nginx-1.14.1/auto/lib/zlib/make
  406. nginx-1.14.1/auto/lib/zlib/makefile.bcc
  407. nginx-1.14.1/auto/lib/zlib/makefile.msvc
  408. nginx-1.14.1/auto/lib/zlib/makefile.owc
  409. nginx-1.14.1/auto/lib/perl/conf
  410. nginx-1.14.1/auto/lib/perl/make
  411. nginx-1.14.1/auto/lib/pcre/conf
  412. nginx-1.14.1/auto/lib/pcre/make
  413. nginx-1.14.1/auto/lib/pcre/makefile.bcc
  414. nginx-1.14.1/auto/lib/pcre/makefile.msvc
  415. nginx-1.14.1/auto/lib/pcre/makefile.owc
  416. nginx-1.14.1/auto/lib/openssl/conf
  417. nginx-1.14.1/auto/lib/openssl/make
  418. nginx-1.14.1/auto/lib/openssl/makefile.bcc
  419. nginx-1.14.1/auto/lib/openssl/makefile.msvc
  420. nginx-1.14.1/auto/lib/libxslt/conf
  421. nginx-1.14.1/auto/lib/libgd/conf
  422. nginx-1.14.1/auto/lib/libatomic/conf
  423. nginx-1.14.1/auto/lib/libatomic/make
  424. nginx-1.14.1/auto/lib/google-perftools/conf
  425. nginx-1.14.1/auto/lib/geoip/conf
  426. nginx-1.14.1/auto/cc/acc
  427. nginx-1.14.1/auto/cc/bcc
  428. nginx-1.14.1/auto/cc/ccc
  429. nginx-1.14.1/auto/cc/clang
  430. nginx-1.14.1/auto/cc/conf
  431. nginx-1.14.1/auto/cc/gcc
  432. nginx-1.14.1/auto/cc/icc
  433. nginx-1.14.1/auto/cc/msvc
  434. nginx-1.14.1/auto/cc/name
  435. nginx-1.14.1/auto/cc/owc
  436. nginx-1.14.1/auto/cc/sunc
复制代码

生成配置文件,将nginx文件安装在/usr/local目录下:

  1. [root@localhost home]# cd nginx-1.14.1
  2. [root@localhost nginx-1.14.1]# ls
  3. auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  Makefile  man  nginx-goodies-nginx-sticky-module-ng-08a395c66e42  objs  README  src
  4. [root@localhost nginx-1.14.1]# ./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid
  5. checking for OS
  6. + Linux 2.6.32-431.el6.x86_64 x86_64
  7. checking for C compiler ... found
  8. + using GNU C compiler
  9. + gcc version: 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
  10. checking for gcc -pipe switch ... found
  11. checking for -Wl,-E switch ... found
  12. checking for gcc builtin atomic operations ... found
  13. checking for C99 variadic macros ... found
  14. checking for gcc variadic macros ... found
  15. checking for gcc builtin 64 bit byteswap ... found
  16. checking for unistd.h ... found
  17. checking for inttypes.h ... found
  18. checking for limits.h ... found
  19. checking for sys/filio.h ... not found
  20. checking for sys/param.h ... found
  21. checking for sys/mount.h ... found
  22. checking for sys/statvfs.h ... found
  23. checking for crypt.h ... found
  24. checking for Linux specific features
  25. checking for epoll ... found
  26. checking for EPOLLRDHUP ... found
  27. checking for EPOLLEXCLUSIVE ... not found
  28. checking for O_PATH ... not found
  29. checking for sendfile() ... found
  30. checking for sendfile64() ... found
  31. checking for sys/prctl.h ... found
  32. checking for prctl(PR_SET_DUMPABLE) ... found
  33. checking for prctl(PR_SET_KEEPCAPS) ... found
  34. checking for capabilities ... found
  35. checking for crypt_r() ... found
  36. checking for sys/vfs.h ... found
  37. checking for nobody group ... found
  38. checking for poll() ... found
  39. checking for /dev/poll ... not found
  40. checking for kqueue ... not found
  41. checking for crypt() ... not found
  42. checking for crypt() in libcrypt ... found
  43. checking for F_READAHEAD ... not found
  44. checking for posix_fadvise() ... found
  45. checking for O_DIRECT ... found
  46. checking for F_NOCACHE ... not found
  47. checking for directio() ... not found
  48. checking for statfs() ... found
  49. checking for statvfs() ... found
  50. checking for dlopen() ... not found
  51. checking for dlopen() in libdl ... found
  52. checking for sched_yield() ... found
  53. checking for sched_setaffinity() ... found
  54. checking for SO_SETFIB ... not found
  55. checking for SO_REUSEPORT ... found
  56. checking for SO_ACCEPTFILTER ... not found
  57. checking for SO_BINDANY ... not found
  58. checking for IP_TRANSPARENT ... found
  59. checking for IP_BINDANY ... not found
  60. checking for IP_BIND_ADDRESS_NO_PORT ... not found
  61. checking for IP_RECVDSTADDR ... not found
  62. checking for IP_SENDSRCADDR ... not found
  63. checking for IP_PKTINFO ... found
  64. checking for IPV6_RECVPKTINFO ... found
  65. checking for TCP_DEFER_ACCEPT ... found
  66. checking for TCP_KEEPIDLE ... found
  67. checking for TCP_FASTOPEN ... not found
  68. checking for TCP_INFO ... found
  69. checking for accept4() ... found
  70. checking for eventfd() ... found
  71. checking for int size ... 4 bytes
  72. checking for long size ... 8 bytes
  73. checking for long long size ... 8 bytes
  74. checking for void * size ... 8 bytes
  75. checking for uint32_t ... found
  76. checking for uint64_t ... found
  77. checking for sig_atomic_t ... found
  78. checking for sig_atomic_t size ... 4 bytes
  79. checking for socklen_t ... found
  80. checking for in_addr_t ... found
  81. checking for in_port_t ... found
  82. checking for rlim_t ... found
  83. checking for uintptr_t ... uintptr_t found
  84. checking for system byte ordering ... little endian
  85. checking for size_t size ... 8 bytes
  86. checking for off_t size ... 8 bytes
  87. checking for time_t size ... 8 bytes
  88. checking for AF_INET6 ... found
  89. checking for setproctitle() ... not found
  90. checking for pread() ... found
  91. checking for pwrite() ... found
  92. checking for pwritev() ... found
  93. checking for sys_nerr ... found
  94. checking for localtime_r() ... found
  95. checking for clock_gettime(CLOCK_MONOTONIC) ... not found
  96. checking for clock_gettime(CLOCK_MONOTONIC) in librt ... found
  97. checking for posix_memalign() ... found
  98. checking for memalign() ... found
  99. checking for mmap(MAP_ANON|MAP_SHARED) ... found
  100. checking for mmap("/dev/zero", MAP_SHARED) ... found
  101. checking for System V shared memory ... found
  102. checking for POSIX semaphores ... not found
  103. checking for POSIX semaphores in libpthread ... found
  104. checking for struct msghdr.msg_control ... found
  105. checking for ioctl(FIONBIO) ... found
  106. checking for struct tm.tm_gmtoff ... found
  107. checking for struct dirent.d_namlen ... not found
  108. checking for struct dirent.d_type ... found
  109. checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
  110. checking for sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
  111. checking for openat(), fstatat() ... found
  112. checking for getaddrinfo() ... found
  113. checking for PCRE library ... found
  114. checking for PCRE JIT support ... not found
  115. checking for zlib library ... found
  116. creating objs/Makefile

  117. Configuration summary
  118.   + using system PCRE library
  119.   + OpenSSL library is not used
  120.   + using system zlib library

  121.   nginx path prefix: "/usr/local/nginx"
  122.   nginx binary file: "/usr/local/nginx/nginx"
  123.   nginx modules path: "/usr/local/nginx/modules"
  124.   nginx configuration prefix: "/usr/local/nginx"
  125.   nginx configuration file: "/usr/local/nginx/nginx.conf"
  126.   nginx pid file: "/usr/local/nginx/nginx.pid"
  127.   nginx error log file: "/usr/local/nginx/logs/error.log"
  128.   nginx http access log file: "/usr/local/nginx/logs/access.log"
  129.   nginx http client request body temporary files: "client_body_temp"
  130.   nginx http proxy temporary files: "proxy_temp"
  131.   nginx http fastcgi temporary files: "fastcgi_temp"
  132.   nginx http uwsgi temporary files: "uwsgi_temp"
  133.   nginx http scgi temporary files: "scgi_temp"
复制代码

生成完毕后会出现Makefile,然后执行安装:
  1. make && make install
  2. [root@localhost nginx-1.14.1]# make && make install
  3. make -f objs/Makefile
  4. make[1]: Entering directory `/home/nginx-1.14.1'
  5. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  6.                 -o objs/src/core/nginx.o \
  7.                 src/core/nginx.c
  8. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  9.                 -o objs/src/core/ngx_log.o \
  10.                 src/core/ngx_log.c
  11. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  12.                 -o objs/src/core/ngx_palloc.o \
  13.                 src/core/ngx_palloc.c
  14. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  15.                 -o objs/src/core/ngx_array.o \
  16.                 src/core/ngx_array.c
  17. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  18.                 -o objs/src/core/ngx_list.o \
  19.                 src/core/ngx_list.c
  20. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  21.                 -o objs/src/core/ngx_hash.o \
  22.                 src/core/ngx_hash.c
  23. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  24.                 -o objs/src/core/ngx_buf.o \
  25.                 src/core/ngx_buf.c
  26. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  27.                 -o objs/src/core/ngx_queue.o \
  28.                 src/core/ngx_queue.c
  29. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  30.                 -o objs/src/core/ngx_output_chain.o \
  31.                 src/core/ngx_output_chain.c
  32. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  33.                 -o objs/src/core/ngx_string.o \
  34.                 src/core/ngx_string.c
  35. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  36.                 -o objs/src/core/ngx_parse.o \
  37.                 src/core/ngx_parse.c
  38. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  39.                 -o objs/src/core/ngx_parse_time.o \
  40.                 src/core/ngx_parse_time.c
  41. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  42.                 -o objs/src/core/ngx_inet.o \
  43.                 src/core/ngx_inet.c
  44. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  45.                 -o objs/src/core/ngx_file.o \
  46.                 src/core/ngx_file.c
  47. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  48.                 -o objs/src/core/ngx_crc32.o \
  49.                 src/core/ngx_crc32.c
  50. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  51.                 -o objs/src/core/ngx_murmurhash.o \
  52.                 src/core/ngx_murmurhash.c
  53. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  54.                 -o objs/src/core/ngx_md5.o \
  55.                 src/core/ngx_md5.c
  56. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  57.                 -o objs/src/core/ngx_sha1.o \
  58.                 src/core/ngx_sha1.c
  59. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  60.                 -o objs/src/core/ngx_rbtree.o \
  61.                 src/core/ngx_rbtree.c
  62. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  63.                 -o objs/src/core/ngx_radix_tree.o \
  64.                 src/core/ngx_radix_tree.c
  65. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  66.                 -o objs/src/core/ngx_slab.o \
  67.                 src/core/ngx_slab.c
  68. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  69.                 -o objs/src/core/ngx_times.o \
  70.                 src/core/ngx_times.c
  71. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  72.                 -o objs/src/core/ngx_shmtx.o \
  73.                 src/core/ngx_shmtx.c
  74. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  75.                 -o objs/src/core/ngx_connection.o \
  76.                 src/core/ngx_connection.c
  77. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  78.                 -o objs/src/core/ngx_cycle.o \
  79.                 src/core/ngx_cycle.c
  80. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  81.                 -o objs/src/core/ngx_spinlock.o \
  82.                 src/core/ngx_spinlock.c
  83. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  84.                 -o objs/src/core/ngx_rwlock.o \
  85.                 src/core/ngx_rwlock.c
  86. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  87.                 -o objs/src/core/ngx_cpuinfo.o \
  88.                 src/core/ngx_cpuinfo.c
  89. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  90.                 -o objs/src/core/ngx_conf_file.o \
  91.                 src/core/ngx_conf_file.c
  92. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  93.                 -o objs/src/core/ngx_module.o \
  94.                 src/core/ngx_module.c
  95. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  96.                 -o objs/src/core/ngx_resolver.o \
  97.                 src/core/ngx_resolver.c
  98. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  99.                 -o objs/src/core/ngx_open_file_cache.o \
  100.                 src/core/ngx_open_file_cache.c
  101. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  102.                 -o objs/src/core/ngx_crypt.o \
  103.                 src/core/ngx_crypt.c
  104. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  105.                 -o objs/src/core/ngx_proxy_protocol.o \
  106.                 src/core/ngx_proxy_protocol.c
  107. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  108.                 -o objs/src/core/ngx_syslog.o \
  109.                 src/core/ngx_syslog.c
  110. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  111.                 -o objs/src/event/ngx_event.o \
  112.                 src/event/ngx_event.c
  113. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  114.                 -o objs/src/event/ngx_event_timer.o \
  115.                 src/event/ngx_event_timer.c
  116. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  117.                 -o objs/src/event/ngx_event_posted.o \
  118.                 src/event/ngx_event_posted.c
  119. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  120.                 -o objs/src/event/ngx_event_accept.o \
  121.                 src/event/ngx_event_accept.c
  122. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  123.                 -o objs/src/event/ngx_event_connect.o \
  124.                 src/event/ngx_event_connect.c
  125. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  126.                 -o objs/src/event/ngx_event_pipe.o \
  127.                 src/event/ngx_event_pipe.c
  128. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  129.                 -o objs/src/os/unix/ngx_time.o \
  130.                 src/os/unix/ngx_time.c
  131. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  132.                 -o objs/src/os/unix/ngx_errno.o \
  133.                 src/os/unix/ngx_errno.c
  134. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  135.                 -o objs/src/os/unix/ngx_alloc.o \
  136.                 src/os/unix/ngx_alloc.c
  137. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  138.                 -o objs/src/os/unix/ngx_files.o \
  139.                 src/os/unix/ngx_files.c
  140. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  141.                 -o objs/src/os/unix/ngx_socket.o \
  142.                 src/os/unix/ngx_socket.c
  143. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  144.                 -o objs/src/os/unix/ngx_recv.o \
  145.                 src/os/unix/ngx_recv.c
  146. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  147.                 -o objs/src/os/unix/ngx_readv_chain.o \
  148.                 src/os/unix/ngx_readv_chain.c
  149. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  150.                 -o objs/src/os/unix/ngx_udp_recv.o \
  151.                 src/os/unix/ngx_udp_recv.c
  152. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  153.                 -o objs/src/os/unix/ngx_send.o \
  154.                 src/os/unix/ngx_send.c
  155. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  156.                 -o objs/src/os/unix/ngx_writev_chain.o \
  157.                 src/os/unix/ngx_writev_chain.c
  158. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  159.                 -o objs/src/os/unix/ngx_udp_send.o \
  160.                 src/os/unix/ngx_udp_send.c
  161. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  162.                 -o objs/src/os/unix/ngx_udp_sendmsg_chain.o \
  163.                 src/os/unix/ngx_udp_sendmsg_chain.c
  164. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  165.                 -o objs/src/os/unix/ngx_channel.o \
  166.                 src/os/unix/ngx_channel.c
  167. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  168.                 -o objs/src/os/unix/ngx_shmem.o \
  169.                 src/os/unix/ngx_shmem.c
  170. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  171.                 -o objs/src/os/unix/ngx_process.o \
  172.                 src/os/unix/ngx_process.c
  173. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  174.                 -o objs/src/os/unix/ngx_daemon.o \
  175.                 src/os/unix/ngx_daemon.c
  176. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  177.                 -o objs/src/os/unix/ngx_setaffinity.o \
  178.                 src/os/unix/ngx_setaffinity.c
  179. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  180.                 -o objs/src/os/unix/ngx_setproctitle.o \
  181.                 src/os/unix/ngx_setproctitle.c
  182. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  183.                 -o objs/src/os/unix/ngx_posix_init.o \
  184.                 src/os/unix/ngx_posix_init.c
  185. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  186.                 -o objs/src/os/unix/ngx_user.o \
  187.                 src/os/unix/ngx_user.c
  188. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  189.                 -o objs/src/os/unix/ngx_dlopen.o \
  190.                 src/os/unix/ngx_dlopen.c
  191. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  192.                 -o objs/src/os/unix/ngx_process_cycle.o \
  193.                 src/os/unix/ngx_process_cycle.c
  194. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  195.                 -o objs/src/os/unix/ngx_linux_init.o \
  196.                 src/os/unix/ngx_linux_init.c
  197. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  198.                 -o objs/src/event/modules/ngx_epoll_module.o \
  199.                 src/event/modules/ngx_epoll_module.c
  200. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  201.                 -o objs/src/os/unix/ngx_linux_sendfile_chain.o \
  202.                 src/os/unix/ngx_linux_sendfile_chain.c
  203. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  204.                 -o objs/src/core/ngx_regex.o \
  205.                 src/core/ngx_regex.c
  206. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  207.                 -o objs/src/http/ngx_http.o \
  208.                 src/http/ngx_http.c
  209. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  210.                 -o objs/src/http/ngx_http_core_module.o \
  211.                 src/http/ngx_http_core_module.c
  212. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  213.                 -o objs/src/http/ngx_http_special_response.o \
  214.                 src/http/ngx_http_special_response.c
  215. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  216.                 -o objs/src/http/ngx_http_request.o \
  217.                 src/http/ngx_http_request.c
  218. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  219.                 -o objs/src/http/ngx_http_parse.o \
  220.                 src/http/ngx_http_parse.c
  221. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  222.                 -o objs/src/http/modules/ngx_http_log_module.o \
  223.                 src/http/modules/ngx_http_log_module.c
  224. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  225.                 -o objs/src/http/ngx_http_request_body.o \
  226.                 src/http/ngx_http_request_body.c
  227. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  228.                 -o objs/src/http/ngx_http_variables.o \
  229.                 src/http/ngx_http_variables.c
  230. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  231.                 -o objs/src/http/ngx_http_script.o \
  232.                 src/http/ngx_http_script.c
  233. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  234.                 -o objs/src/http/ngx_http_upstream.o \
  235.                 src/http/ngx_http_upstream.c
  236. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  237.                 -o objs/src/http/ngx_http_upstream_round_robin.o \
  238.                 src/http/ngx_http_upstream_round_robin.c
  239. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  240.                 -o objs/src/http/ngx_http_file_cache.o \
  241.                 src/http/ngx_http_file_cache.c
  242. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  243.                 -o objs/src/http/ngx_http_write_filter_module.o \
  244.                 src/http/ngx_http_write_filter_module.c
  245. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  246.                 -o objs/src/http/ngx_http_header_filter_module.o \
  247.                 src/http/ngx_http_header_filter_module.c
  248. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  249.                 -o objs/src/http/modules/ngx_http_chunked_filter_module.o \
  250.                 src/http/modules/ngx_http_chunked_filter_module.c
  251. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  252.                 -o objs/src/http/modules/ngx_http_range_filter_module.o \
  253.                 src/http/modules/ngx_http_range_filter_module.c
  254. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  255.                 -o objs/src/http/modules/ngx_http_gzip_filter_module.o \
  256.                 src/http/modules/ngx_http_gzip_filter_module.c
  257. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  258.                 -o objs/src/http/ngx_http_postpone_filter_module.o \
  259.                 src/http/ngx_http_postpone_filter_module.c
  260. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  261.                 -o objs/src/http/modules/ngx_http_ssi_filter_module.o \
  262.                 src/http/modules/ngx_http_ssi_filter_module.c
  263. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  264.                 -o objs/src/http/modules/ngx_http_charset_filter_module.o \
  265.                 src/http/modules/ngx_http_charset_filter_module.c
  266. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  267.                 -o objs/src/http/modules/ngx_http_userid_filter_module.o \
  268.                 src/http/modules/ngx_http_userid_filter_module.c
  269. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  270.                 -o objs/src/http/modules/ngx_http_headers_filter_module.o \
  271.                 src/http/modules/ngx_http_headers_filter_module.c
  272. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  273.                 -o objs/src/http/ngx_http_copy_filter_module.o \
  274.                 src/http/ngx_http_copy_filter_module.c
  275. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  276.                 -o objs/src/http/modules/ngx_http_not_modified_filter_module.o \
  277.                 src/http/modules/ngx_http_not_modified_filter_module.c
  278. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  279.                 -o objs/src/http/modules/ngx_http_static_module.o \
  280.                 src/http/modules/ngx_http_static_module.c
  281. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  282.                 -o objs/src/http/modules/ngx_http_autoindex_module.o \
  283.                 src/http/modules/ngx_http_autoindex_module.c
  284. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  285.                 -o objs/src/http/modules/ngx_http_index_module.o \
  286.                 src/http/modules/ngx_http_index_module.c
  287. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  288.                 -o objs/src/http/modules/ngx_http_mirror_module.o \
  289.                 src/http/modules/ngx_http_mirror_module.c
  290. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  291.                 -o objs/src/http/modules/ngx_http_try_files_module.o \
  292.                 src/http/modules/ngx_http_try_files_module.c
  293. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  294.                 -o objs/src/http/modules/ngx_http_auth_basic_module.o \
  295.                 src/http/modules/ngx_http_auth_basic_module.c
  296. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  297.                 -o objs/src/http/modules/ngx_http_access_module.o \
  298.                 src/http/modules/ngx_http_access_module.c
  299. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  300.                 -o objs/src/http/modules/ngx_http_limit_conn_module.o \
  301.                 src/http/modules/ngx_http_limit_conn_module.c
  302. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  303.                 -o objs/src/http/modules/ngx_http_limit_req_module.o \
  304.                 src/http/modules/ngx_http_limit_req_module.c
  305. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  306.                 -o objs/src/http/modules/ngx_http_geo_module.o \
  307.                 src/http/modules/ngx_http_geo_module.c
  308. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  309.                 -o objs/src/http/modules/ngx_http_map_module.o \
  310.                 src/http/modules/ngx_http_map_module.c
  311. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  312.                 -o objs/src/http/modules/ngx_http_split_clients_module.o \
  313.                 src/http/modules/ngx_http_split_clients_module.c
  314. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  315.                 -o objs/src/http/modules/ngx_http_referer_module.o \
  316.                 src/http/modules/ngx_http_referer_module.c
  317. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  318.                 -o objs/src/http/modules/ngx_http_rewrite_module.o \
  319.                 src/http/modules/ngx_http_rewrite_module.c
  320. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  321.                 -o objs/src/http/modules/ngx_http_proxy_module.o \
  322.                 src/http/modules/ngx_http_proxy_module.c
  323. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  324.                 -o objs/src/http/modules/ngx_http_fastcgi_module.o \
  325.                 src/http/modules/ngx_http_fastcgi_module.c
  326. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  327.                 -o objs/src/http/modules/ngx_http_uwsgi_module.o \
  328.                 src/http/modules/ngx_http_uwsgi_module.c
  329. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  330.                 -o objs/src/http/modules/ngx_http_scgi_module.o \
  331.                 src/http/modules/ngx_http_scgi_module.c
  332. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  333.                 -o objs/src/http/modules/ngx_http_memcached_module.o \
  334.                 src/http/modules/ngx_http_memcached_module.c
  335. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  336.                 -o objs/src/http/modules/ngx_http_empty_gif_module.o \
  337.                 src/http/modules/ngx_http_empty_gif_module.c
  338. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  339.                 -o objs/src/http/modules/ngx_http_browser_module.o \
  340.                 src/http/modules/ngx_http_browser_module.c
  341. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  342.                 -o objs/src/http/modules/ngx_http_upstream_hash_module.o \
  343.                 src/http/modules/ngx_http_upstream_hash_module.c
  344. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  345.                 -o objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
  346.                 src/http/modules/ngx_http_upstream_ip_hash_module.c
  347. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  348.                 -o objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
  349.                 src/http/modules/ngx_http_upstream_least_conn_module.c
  350. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  351.                 -o objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
  352.                 src/http/modules/ngx_http_upstream_keepalive_module.c
  353. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
  354.                 -o objs/src/http/modules/ngx_http_upstream_zone_module.o \
  355.                 src/http/modules/ngx_http_upstream_zone_module.c
  356. cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
  357.                 -o objs/ngx_modules.o \
  358.                 objs/ngx_modules.c
  359. cc -o objs/nginx \
  360.         objs/src/core/nginx.o \
  361.         objs/src/core/ngx_log.o \
  362.         objs/src/core/ngx_palloc.o \
  363.         objs/src/core/ngx_array.o \
  364.         objs/src/core/ngx_list.o \
  365.         objs/src/core/ngx_hash.o \
  366.         objs/src/core/ngx_buf.o \
  367.         objs/src/core/ngx_queue.o \
  368.         objs/src/core/ngx_output_chain.o \
  369.         objs/src/core/ngx_string.o \
  370.         objs/src/core/ngx_parse.o \
  371.         objs/src/core/ngx_parse_time.o \
  372.         objs/src/core/ngx_inet.o \
  373.         objs/src/core/ngx_file.o \
  374.         objs/src/core/ngx_crc32.o \
  375.         objs/src/core/ngx_murmurhash.o \
  376.         objs/src/core/ngx_md5.o \
  377.         objs/src/core/ngx_sha1.o \
  378.         objs/src/core/ngx_rbtree.o \
  379.         objs/src/core/ngx_radix_tree.o \
  380.         objs/src/core/ngx_slab.o \
  381.         objs/src/core/ngx_times.o \
  382.         objs/src/core/ngx_shmtx.o \
  383.         objs/src/core/ngx_connection.o \
  384.         objs/src/core/ngx_cycle.o \
  385.         objs/src/core/ngx_spinlock.o \
  386.         objs/src/core/ngx_rwlock.o \
  387.         objs/src/core/ngx_cpuinfo.o \
  388.         objs/src/core/ngx_conf_file.o \
  389.         objs/src/core/ngx_module.o \
  390.         objs/src/core/ngx_resolver.o \
  391.         objs/src/core/ngx_open_file_cache.o \
  392.         objs/src/core/ngx_crypt.o \
  393.         objs/src/core/ngx_proxy_protocol.o \
  394.         objs/src/core/ngx_syslog.o \
  395.         objs/src/event/ngx_event.o \
  396.         objs/src/event/ngx_event_timer.o \
  397.         objs/src/event/ngx_event_posted.o \
  398.         objs/src/event/ngx_event_accept.o \
  399.         objs/src/event/ngx_event_connect.o \
  400.         objs/src/event/ngx_event_pipe.o \
  401.         objs/src/os/unix/ngx_time.o \
  402.         objs/src/os/unix/ngx_errno.o \
  403.         objs/src/os/unix/ngx_alloc.o \
  404.         objs/src/os/unix/ngx_files.o \
  405.         objs/src/os/unix/ngx_socket.o \
  406.         objs/src/os/unix/ngx_recv.o \
  407.         objs/src/os/unix/ngx_readv_chain.o \
  408.         objs/src/os/unix/ngx_udp_recv.o \
  409.         objs/src/os/unix/ngx_send.o \
  410.         objs/src/os/unix/ngx_writev_chain.o \
  411.         objs/src/os/unix/ngx_udp_send.o \
  412.         objs/src/os/unix/ngx_udp_sendmsg_chain.o \
  413.         objs/src/os/unix/ngx_channel.o \
  414.         objs/src/os/unix/ngx_shmem.o \
  415.         objs/src/os/unix/ngx_process.o \
  416.         objs/src/os/unix/ngx_daemon.o \
  417.         objs/src/os/unix/ngx_setaffinity.o \
  418.         objs/src/os/unix/ngx_setproctitle.o \
  419.         objs/src/os/unix/ngx_posix_init.o \
  420.         objs/src/os/unix/ngx_user.o \
  421.         objs/src/os/unix/ngx_dlopen.o \
  422.         objs/src/os/unix/ngx_process_cycle.o \
  423.         objs/src/os/unix/ngx_linux_init.o \
  424.         objs/src/event/modules/ngx_epoll_module.o \
  425.         objs/src/os/unix/ngx_linux_sendfile_chain.o \
  426.         objs/src/core/ngx_regex.o \
  427.         objs/src/http/ngx_http.o \
  428.         objs/src/http/ngx_http_core_module.o \
  429.         objs/src/http/ngx_http_special_response.o \
  430.         objs/src/http/ngx_http_request.o \
  431.         objs/src/http/ngx_http_parse.o \
  432.         objs/src/http/modules/ngx_http_log_module.o \
  433.         objs/src/http/ngx_http_request_body.o \
  434.         objs/src/http/ngx_http_variables.o \
  435.         objs/src/http/ngx_http_script.o \
  436.         objs/src/http/ngx_http_upstream.o \
  437.         objs/src/http/ngx_http_upstream_round_robin.o \
  438.         objs/src/http/ngx_http_file_cache.o \
  439.         objs/src/http/ngx_http_write_filter_module.o \
  440.         objs/src/http/ngx_http_header_filter_module.o \
  441.         objs/src/http/modules/ngx_http_chunked_filter_module.o \
  442.         objs/src/http/modules/ngx_http_range_filter_module.o \
  443.         objs/src/http/modules/ngx_http_gzip_filter_module.o \
  444.         objs/src/http/ngx_http_postpone_filter_module.o \
  445.         objs/src/http/modules/ngx_http_ssi_filter_module.o \
  446.         objs/src/http/modules/ngx_http_charset_filter_module.o \
  447.         objs/src/http/modules/ngx_http_userid_filter_module.o \
  448.         objs/src/http/modules/ngx_http_headers_filter_module.o \
  449.         objs/src/http/ngx_http_copy_filter_module.o \
  450.         objs/src/http/modules/ngx_http_not_modified_filter_module.o \
  451.         objs/src/http/modules/ngx_http_static_module.o \
  452.         objs/src/http/modules/ngx_http_autoindex_module.o \
  453.         objs/src/http/modules/ngx_http_index_module.o \
  454.         objs/src/http/modules/ngx_http_mirror_module.o \
  455.         objs/src/http/modules/ngx_http_try_files_module.o \
  456.         objs/src/http/modules/ngx_http_auth_basic_module.o \
  457.         objs/src/http/modules/ngx_http_access_module.o \
  458.         objs/src/http/modules/ngx_http_limit_conn_module.o \
  459.         objs/src/http/modules/ngx_http_limit_req_module.o \
  460.         objs/src/http/modules/ngx_http_geo_module.o \
  461.         objs/src/http/modules/ngx_http_map_module.o \
  462.         objs/src/http/modules/ngx_http_split_clients_module.o \
  463.         objs/src/http/modules/ngx_http_referer_module.o \
  464.         objs/src/http/modules/ngx_http_rewrite_module.o \
  465.         objs/src/http/modules/ngx_http_proxy_module.o \
  466.         objs/src/http/modules/ngx_http_fastcgi_module.o \
  467.         objs/src/http/modules/ngx_http_uwsgi_module.o \
  468.         objs/src/http/modules/ngx_http_scgi_module.o \
  469.         objs/src/http/modules/ngx_http_memcached_module.o \
  470.         objs/src/http/modules/ngx_http_empty_gif_module.o \
  471.         objs/src/http/modules/ngx_http_browser_module.o \
  472.         objs/src/http/modules/ngx_http_upstream_hash_module.o \
  473.         objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
  474.         objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
  475.         objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
  476.         objs/src/http/modules/ngx_http_upstream_zone_module.o \
  477.         objs/ngx_modules.o \
  478.         -ldl -lrt -lpthread -lcrypt -lpcre -lz \
  479.         -Wl,-E
  480. sed -e "s|%%PREFIX%%|/usr/local/nginx|" \
  481.                 -e "s|%%PID_PATH%%|/usr/local/nginx/nginx.pid|" \
  482.                 -e "s|%%CONF_PATH%%|/usr/local/nginx/nginx.conf|" \
  483.                 -e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \
  484.                 < man/nginx.8 > objs/nginx.8
  485. make[1]: Leaving directory `/home/nginx-1.14.1'
  486. make -f objs/Makefile install
  487. make[1]: Entering directory `/home/nginx-1.14.1'
  488. test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
  489. test -d '/usr/local/nginx' \
  490.                 || mkdir -p '/usr/local/nginx'
  491. test ! -f '/usr/local/nginx/nginx' \
  492.                 || mv '/usr/local/nginx/nginx' \
  493.                         '/usr/local/nginx/nginx.old'
  494. cp objs/nginx '/usr/local/nginx/nginx'
  495. test -d '/usr/local/nginx' \
  496.                 || mkdir -p '/usr/local/nginx'
  497. cp conf/koi-win '/usr/local/nginx'
  498. cp conf/koi-utf '/usr/local/nginx'
  499. cp conf/win-utf '/usr/local/nginx'
  500. test -f '/usr/local/nginx/mime.types' \
  501.                 || cp conf/mime.types '/usr/local/nginx'
  502. cp conf/mime.types '/usr/local/nginx/mime.types.default'
  503. test -f '/usr/local/nginx/fastcgi_params' \
  504.                 || cp conf/fastcgi_params '/usr/local/nginx'
  505. cp conf/fastcgi_params \
  506.                 '/usr/local/nginx/fastcgi_params.default'
  507. test -f '/usr/local/nginx/fastcgi.conf' \
  508.                 || cp conf/fastcgi.conf '/usr/local/nginx'
  509. cp conf/fastcgi.conf '/usr/local/nginx/fastcgi.conf.default'
  510. test -f '/usr/local/nginx/uwsgi_params' \
  511.                 || cp conf/uwsgi_params '/usr/local/nginx'
  512. cp conf/uwsgi_params \
  513.                 '/usr/local/nginx/uwsgi_params.default'
  514. test -f '/usr/local/nginx/scgi_params' \
  515.                 || cp conf/scgi_params '/usr/local/nginx'
  516. cp conf/scgi_params \
  517.                 '/usr/local/nginx/scgi_params.default'
  518. test -f '/usr/local/nginx/nginx.conf' \
  519.                 || cp conf/nginx.conf '/usr/local/nginx/nginx.conf'
  520. cp conf/nginx.conf '/usr/local/nginx/nginx.conf.default'
  521. test -d '/usr/local/nginx' \
  522.                 || mkdir -p '/usr/local/nginx'
  523. test -d '/usr/local/nginx/logs' \
  524.                 || mkdir -p '/usr/local/nginx/logs'
  525. test -d '/usr/local/nginx/html' \
  526.                 || cp -R html '/usr/local/nginx'
  527. test -d '/usr/local/nginx/logs' \
  528.                 || mkdir -p '/usr/local/nginx/logs'
  529. make[1]: Leaving directory `/home/nginx-1.14.1'
复制代码

最后测试,启动nginx查看是否能够访问默认页面:
  1. [root@localhost nginx-1.14.1]# cd /usr/local/nginx
  2. [root@localhost nginx]# ls
  3. fastcgi.conf          fastcgi_params.default  koi-win     mime.types.default  nginx.conf.default   uwsgi_params
  4. fastcgi.conf.default  html                    logs        nginx               scgi_params          uwsgi_params.default
  5. fastcgi_params        koi-utf                 mime.types  nginx.conf          scgi_params.default  win-utf
  6. [root@localhost nginx]# ./nginx
  7. [root@localhost nginx]# ss -ant | grep 80
  8. LISTEN     0      128                       *:80                       *:*     
复制代码




出现上述页面表示测试成功。


接下来就可以配置nginx的服务器负载均衡功能了。


测试环境:静态的web页面。
测试方法:在同一台服务器上依据上述方法部署nginx1和nginx2,分别使用81和82端口。修改静态页面标注以方便识别nginx1和nginx2两台不同的web服务器。nginx本身作为反向代理进行负载均衡(轮询)。


配置nginx的nginx.conf文件:


修改如下几处地方:


  1. #gzip  on;

  2. upstream webapp  {
  3.                  server 192.168.1.133:81;
  4.                  server 192.168.1.133:82;
  5.          }

  6.     server {
  7.         listen       80;
  8.         server_name  localhost;
复制代码


  1. #access_log  logs/host.access.log  main;

  2.         location / {
  3.                 proxy_pass   http://webapp;
  4.                         }

  5.         #error_page  404              /404.html;
复制代码

配置完成后,记得重启nginx以使配置生效:
  1. [root@localhost nginx]# ./nginx -s stop
  2. [root@localhost nginx]# ./nginx
复制代码

然后重新访问80端口,并多次刷新测试:
第一次打开:





刷新一下:





反复刷新nginx1和nginx2轮流显示,则说明nginx轮询负载均衡配置成功!


上述只是介绍了最简单的静态页面负载均衡,后续有空的话分享配置具有会话保持功能的nginx负载均衡!

【时间有限,帖子写的比较匆忙,有误之处烦请小伙伴们及时指出以便进行改正!谢谢】

打赏鼓励作者,期待更多好文!

打赏
暂无人打赏

主动出击 发表于 2018-11-29 14:09
  
感谢分享,楼主辛苦了。
feeling 发表于 2018-11-29 14:54
  
学习了,很复杂啊
好心情能长寿 发表于 2018-11-29 18:25
  
学习了,很不错
申铭科技 发表于 2018-11-30 13:25
  
这个必须点赞
Remblue 发表于 2018-11-30 14:01
  
资料很好   谢谢分享
新手612152 发表于 2020-3-15 20:08
  
来学习一波
司马缸砸了光 发表于 2020-3-25 09:23
  
写的好详细。
J555000 发表于 2020-4-7 16:31
  
nginx服务器 在深信服AC 内网NAT环境下,能够获取外网的真实IP吗?
我获取的真实IP始终是 AC的内网地址。
FuJun 发表于 2024-6-7 10:58
  
打卡学习,感谢大佬分享!
发表新帖
热门标签
全部标签>
西北区每日一问
技术盲盒
安全效果
【 社区to talk】
技术笔记
干货满满
每日一问
信服课堂视频
新版本体验
GIF动图学习
技术咨询
功能体验
2023技术争霸赛专题
产品连连看
安装部署配置
通用技术
秒懂零信任
技术晨报
自助服务平台操作指引
原创分享
标准化排查
排障笔记本
玩转零信任
排障那些事
SDP百科
深信服技术支持平台
POC测试案例
畅聊IT
答题自测
专家问答
技术圆桌
在线直播
MVP
网络基础知识
升级
安全攻防
上网策略
测试报告
日志审计
问题分析处理
流量管理
每日一记
运维工具
云计算知识
用户认证
解决方案
sangfor周刊
VPN 对接
项目案例
SANGFOR资讯
专家分享
技术顾问
信服故事
功能咨询
终端接入
授权
设备维护
资源访问
地址转换
虚拟机
存储
迁移
加速技术
产品预警公告
信服圈儿
S豆商城资讯
技术争霸赛
「智能机器人」
追光者计划
社区帮助指南
答题榜单公布
纪元平台
卧龙计划
华北区拉练
天逸直播
以战代练
山东区技术晨报
文档捉虫活动
齐鲁TV
华北区交付直播
每周精选
2024年技术争霸赛
北京区每日一练
场景专题
故障笔记
高手请过招
升级&主动服务
高频问题集锦
社区新周刊
全能先锋系列
云化安全能力

本版版主

12
185
6

发帖

粉丝

关注

121
315
351

发帖

粉丝

关注

本版达人

LoveTec...

本周分享达人

新手24116...

本周提问达人