user nobody;

worker_processes 1;

error_log logs/error.log;

error_log logs/error.log notice;

error_log logs/error.log info;

pid logs/nginx.pid;

events { worker_connections 1024; }

http { include mime.types; default_type application/octet-stream;

  1. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  2. # '$status $body_bytes_sent "$http_referer" '
  3. # '"$http_user_agent" "$http_x_forwarded_for"';
  4. #access_log logs/access.log main;
  5. sendfile off;
  6. #tcp_nopush on;
  7. #keepalive_timeout 0;
  8. keepalive_timeout 65;
  9. #gzip on;
  10. #核心转发
  11. upstream pig.com {
  12. server 192.168.10.162:8081 weight=1 max_fails=1 fail_timeout=30s;
  13. }
  14. upstream housefund.com {
  15. server 192.168.10.161:8082 weight=1 max_fails=1 fail_timeout=30s;
  16. }
  17. upstream zhfw.com {
  18. server 192.168.10.162:8887 weight=1 max_fails=1 fail_timeout=30s;
  19. }
  20. server {
  21. listen 9080;
  22. server_name localhost;
  23. location /zhfwv {
  24. alias /home/docker/docker_zhfw_gs/dist;
  25. index index.html index.htm;
  26. add_header Cache-Control no-cache;
  27. }
  28. location / {
  29. root /home/docker/docker_web6/dist;
  30. index index.html index.htm;
  31. add_header Cache-Control no-cache;
  32. }
  33. location ^~ /zhfwjk/ {
  34. proxy_pass http://192.168.10.162:37608;
  35. proxy_redirect default;
  36. client_max_body_size 100M;
  37. proxy_set_header Host $http_host;
  38. proxy_set_header X-Real-IP $remote_addr;
  39. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  40. }
  41. location ^~ /auth/ {
  42. proxy_pass http://192.168.10.162:37608;
  43. proxy_redirect default;
  44. client_max_body_size 100M;
  45. proxy_set_header Host $http_host;
  46. proxy_set_header X-Real-IP $remote_addr;
  47. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  48. }
  49. location ^~ /zhfw/ {
  50. proxy_pass http://zhfw.com;
  51. proxy_redirect default;
  52. client_max_body_size 100M;
  53. proxy_set_header Host $http_host;
  54. proxy_set_header X-Real-IP $remote_addr;
  55. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  56. }
  57. }
  58. server {
  59. listen 8083;
  60. location / {
  61. proxy_pass http://pig.com;
  62. proxy_redirect default;
  63. client_max_body_size 100M;
  64. proxy_set_header Host $http_host;
  65. proxy_set_header X-Real-IP $remote_addr;
  66. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  67. }
  68. error_page 500 502 503 504 /50x.html;
  69. location = /50x.html {
  70. root html;
  71. }
  72. }
  73. # server{
  74. # listen 8082;
  75. #
  76. # location ^~ /housefund/ {
  77. # proxy_pass http://housefund.com;
  78. # proxy_redirect default;
  79. # client_max_body_size 100M;
  80. # proxy_set_header Host $http_host;
  81. # proxy_set_header X-Real-IP $remote_addr;
  82. # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  83. # }
  84. #
  85. # error_page 500 502 503 504 /50x.html;
  86. # location = /50x.html {
  87. # root html;
  88. # }
  89. #
  90. # }
  91. server {
  92. listen 80;
  93. server_name localhost;
  94. #charset koi8-r;
  95. #access_log logs/host.access.log main;
  96. location / {
  97. root html;
  98. index index.html index.htm;
  99. }
  100. #error_page 404 /404.html;
  101. # redirect server error pages to the static page /50x.html
  102. #
  103. error_page 500 502 503 504 /50x.html;
  104. location = /50x.html {
  105. root html;
  106. }
  107. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  108. #
  109. #location ~ \.php$ {
  110. # proxy_pass http://127.0.0.1;
  111. #}
  112. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  113. #
  114. #location ~ \.php$ {
  115. # root html;
  116. # fastcgi_pass 127.0.0.1:9000;
  117. # fastcgi_index index.php;
  118. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  119. # include fastcgi_params;
  120. #}
  121. # deny access to .htaccess files, if Apache's document root
  122. # concurs with nginx's one
  123. #
  124. #location ~ /\.ht {
  125. # deny all;
  126. #}
  127. }
  128. # another virtual host using mix of IP-, name-, and port-based configuration
  129. #
  130. #server {
  131. # listen 8000;
  132. # listen somename:8080;
  133. # server_name somename alias another.alias;
  134. # location / {
  135. # root html;
  136. # index index.html index.htm;
  137. # }
  138. #}
  139. # HTTPS server
  140. #
  141. #server {
  142. # listen 443 ssl;
  143. # server_name localhost;
  144. # ssl_certificate cert.pem;
  145. # ssl_certificate_key cert.key;
  146. # ssl_session_cache shared:SSL:1m;
  147. # ssl_session_timeout 5m;
  148. # ssl_ciphers HIGH:!aNULL:!MD5;
  149. # ssl_prefer_server_ciphers on;
  150. # location / {
  151. # root html;
  152. # index index.html index.htm;
  153. # }
  154. #}

}