Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.07 KB | None | 0 0
  1. root@node1:/home/xisen# nginx -T
  2. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
  3. nginx: configuration file /etc/nginx/nginx.conf test is successful
  4. # configuration file /etc/nginx/nginx.conf:
  5. user www-data;
  6. worker_processes auto;
  7. pid /run/nginx.pid;
  8.  
  9. events {
  10. worker_connections 768;
  11. # multi_accept on;
  12. }
  13.  
  14. http {
  15.  
  16.  
  17. ##
  18. # Basic Settings
  19. ##
  20.  
  21. sendfile on;
  22. tcp_nopush on;
  23. tcp_nodelay on;
  24. keepalive_timeout 65;
  25. types_hash_max_size 2048;
  26. # server_tokens off;
  27.  
  28. # server_names_hash_bucket_size 64;
  29. # server_name_in_redirect off;
  30.  
  31. include /etc/nginx/mime.types;
  32. default_type application/octet-stream;
  33.  
  34. ##
  35. # SSL Settings
  36. ##
  37.  
  38. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  39. ssl_prefer_server_ciphers on;
  40.  
  41. ##
  42. # Logging Settings
  43. ##
  44.  
  45. access_log /var/log/nginx/access.log;
  46. error_log /var/log/nginx/error.log;
  47.  
  48. ##
  49. # Gzip Settings
  50. ##
  51.  
  52. gzip on;
  53. gzip_disable "msie6";
  54.  
  55. # gzip_vary on;
  56. # gzip_proxied any;
  57. # gzip_comp_level 6;
  58. # gzip_buffers 16 8k;
  59. # gzip_http_version 1.1;
  60. # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  61.  
  62. ##
  63. # Virtual Host Configs
  64. ##
  65.  
  66. include /etc/nginx/conf.d/*.conf;
  67. # include /etc/nginx/sites-enabled/*;
  68. }
  69.  
  70.  
  71. #mail {
  72. # # See sample authentication script at:
  73. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  74. #
  75. # # auth_http localhost/auth.php;
  76. # # pop3_capabilities "TOP" "USER";
  77. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  78. #
  79. # server {
  80. # listen localhost:110;
  81. # protocol pop3;
  82. # proxy on;
  83. # }
  84. #
  85. # server {
  86. # listen localhost:143;
  87. # protocol imap;
  88. # proxy on;
  89. # }
  90. #}
  91.  
  92. # configuration file /etc/nginx/mime.types:
  93.  
  94. types {
  95. text/html html htm shtml;
  96. text/css css;
  97. text/xml xml;
  98. image/gif gif;
  99. image/jpeg jpeg jpg;
  100. application/javascript js;
  101. application/atom+xml atom;
  102. application/rss+xml rss;
  103.  
  104. text/mathml mml;
  105. text/plain txt;
  106. text/vnd.sun.j2me.app-descriptor jad;
  107. text/vnd.wap.wml wml;
  108. text/x-component htc;
  109.  
  110. image/png png;
  111. image/tiff tif tiff;
  112. image/vnd.wap.wbmp wbmp;
  113. image/x-icon ico;
  114. image/x-jng jng;
  115. image/x-ms-bmp bmp;
  116. image/svg+xml svg svgz;
  117. image/webp webp;
  118.  
  119. application/font-woff woff;
  120. application/java-archive jar war ear;
  121. application/json json;
  122. application/mac-binhex40 hqx;
  123. application/msword doc;
  124. application/pdf pdf;
  125. application/postscript ps eps ai;
  126. application/rtf rtf;
  127. application/vnd.apple.mpegurl m3u8;
  128. application/vnd.ms-excel xls;
  129. application/vnd.ms-fontobject eot;
  130. application/vnd.ms-powerpoint ppt;
  131. application/vnd.wap.wmlc wmlc;
  132. application/vnd.google-earth.kml+xml kml;
  133. application/vnd.google-earth.kmz kmz;
  134. application/x-7z-compressed 7z;
  135. application/x-cocoa cco;
  136. application/x-java-archive-diff jardiff;
  137. application/x-java-jnlp-file jnlp;
  138. application/x-makeself run;
  139. application/x-perl pl pm;
  140. application/x-pilot prc pdb;
  141. application/x-rar-compressed rar;
  142. application/x-redhat-package-manager rpm;
  143. application/x-sea sea;
  144. application/x-shockwave-flash swf;
  145. application/x-stuffit sit;
  146. application/x-tcl tcl tk;
  147. application/x-x509-ca-cert der pem crt;
  148. application/x-xpinstall xpi;
  149. application/xhtml+xml xhtml;
  150. application/xspf+xml xspf;
  151. application/zip zip;
  152.  
  153. application/octet-stream bin exe dll;
  154. application/octet-stream deb;
  155. application/octet-stream dmg;
  156. application/octet-stream iso img;
  157. application/octet-stream msi msp msm;
  158.  
  159. application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
  160. application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
  161. application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
  162.  
  163. audio/midi mid midi kar;
  164. audio/mpeg mp3;
  165. audio/ogg ogg;
  166. audio/x-m4a m4a;
  167. audio/x-realaudio ra;
  168.  
  169. video/3gpp 3gpp 3gp;
  170. video/mp2t ts;
  171. video/mp4 mp4;
  172. video/mpeg mpeg mpg;
  173. video/quicktime mov;
  174. video/webm webm;
  175. video/x-flv flv;
  176. video/x-m4v m4v;
  177. video/x-mng mng;
  178. video/x-ms-asf asx asf;
  179. video/x-ms-wmv wmv;
  180. video/x-msvideo avi;
  181. }
  182.  
  183. # configuration file /etc/nginx/conf.d/logformat.conf:
  184. log_format default_json escape=json '{ "timestamp": "$time_iso8601", '
  185. '"clientip": "$remote_addr", '
  186. '"status": "$status", '
  187. '"scheme": "$scheme", '
  188. '"method": "$request_method", '
  189. '"server_port": "$server_port", '
  190. '"server_protocol": "$server_protocol", '
  191. '"upgrade": "$http_upgrade", '
  192. '"request": "$request_uri", '
  193. '"request_time": "$request_time", '
  194. '"upstream": "$upstream_addr", '
  195. '"upstream_status": "$upstream_status", '
  196. '"upstream_response_time": "$upstream_response_time", '
  197. '"host": "$host", '
  198. '"user_agent": "$http_user_agent",'
  199. '"cache": "$upstream_cache_status", '
  200. '"gzip_ratio": "$gzip_ratio", '
  201. '"size": "$bytes_sent", '
  202. '"http_referer": "$http_referer" ,'
  203. '"remote_user": "$remote_user" , '
  204. '"ssl_cipher": "$ssl_cipher" , '
  205. '"ssl_protocol": "$ssl_protocol" , '
  206. '"cookie_session": "$uid_got" , '
  207. '"verison": "$http_Version" , '
  208. '"app-user-id": "$http_App_User_Id" } ';
  209.  
  210. # configuration file /etc/nginx/conf.d/nginx-balancer-config.conf:
  211. upstream balancer {
  212. server 192.168.1.18:9000;
  213. # server 192.168.1.19:9000;
  214. server 192.168.1.20:9000;
  215. }
  216.  
  217. server {
  218.  
  219. listen 80;
  220.  
  221. location / {
  222. proxy_pass http://balancer;
  223. proxy_set_header Host $host;
  224. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  225. proxy_set_header X-Real-IP $remote_addr;
  226.  
  227.  
  228. }
  229. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement