nginx.conf 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ; server {
  2. ; listen 80;
  3. ; server_name www.cofortest.com;
  4. ; root /usr/share/nginx/html;
  5. ; #charset koi8-r;
  6. ; client_max_body_size 100m;
  7. ; #access_log logs/host.access.log main;
  8. ;
  9. ; # 开启代理缓冲区
  10. ; proxy_buffering on;
  11. ; # 响应头的缓冲区
  12. ; proxy_buffer_size 128k;
  13. ; # 网页内容缓冲区的个数为4,单个大小为1M
  14. ; proxy_buffers 8 1M;
  15. ; proxy_busy_buffers_size 2M;
  16. ;
  17. ; location / {
  18. ; root /usr/share/nginx/html;
  19. ; }
  20. ;
  21. ; location /api {
  22. ; proxy_set_header Host $host;
  23. ; proxy_set_header X-Real-IP $remote_addr;
  24. ; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  25. ; proxy_pass http://backend:8080;
  26. ; proxy_connect_timeout 1200s;
  27. ; proxy_read_timeout 1200s;
  28. ; proxy_send_timeout 1200s;
  29. ; }
  30. ;
  31. ; location /recommendationtest {
  32. ; proxy_pass http://taskRecommend:7477;
  33. ; }
  34. ;
  35. ; #error_page 404 /404.html;
  36. ;
  37. ; # redirect server error pages to the static page /50x.html
  38. ; #
  39. ; error_page 500 502 503 504 /50x.html;
  40. ; location = /50x.html {
  41. ; root html;
  42. ; }
  43. ; }
  44. server {
  45. listen 80;
  46. server_name 8.134.32.27;
  47. root /usr/share/nginx/html;
  48. #charset koi8-r;
  49. client_max_body_size 100m;
  50. #access_log logs/host.access.log main;
  51. # 开启代理缓冲区
  52. proxy_buffering on;
  53. # 响应头的缓冲区
  54. proxy_buffer_size 128k;
  55. # 网页内容缓冲区的个数为4,单个大小为1M
  56. proxy_buffers 8 1M;
  57. proxy_busy_buffers_size 2M;
  58. location / {
  59. root /usr/share/nginx/html;
  60. }
  61. location /api {
  62. proxy_set_header Host $host;
  63. proxy_set_header X-Real-IP $remote_addr;
  64. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  65. proxy_pass http://backend:8080;
  66. proxy_connect_timeout 1200s;
  67. proxy_read_timeout 1200s;
  68. proxy_send_timeout 1200s;
  69. }
  70. location /recommendationtest {
  71. proxy_pass http://taskRecommend:7477;
  72. }
  73. #error_page 404 /404.html;
  74. # redirect server error pages to the static page /50x.html
  75. #
  76. error_page 500 502 503 504 /50x.html;
  77. location = /50x.html {
  78. root html;
  79. }
  80. }