nginx.conf 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. worker_processes 1;
  2. events {
  3. worker_connections 1024;
  4. }
  5. http {
  6. include mime.types;
  7. default_type application/octet-stream;
  8. sendfile on;
  9. keepalive_timeout 65;
  10. client_max_body_size 50m;
  11. # upstream websocket_backend {
  12. # server websocket_server_address:port; # 替换为你的 WebSocket 服务器地址和端口
  13. # }
  14. server {
  15. listen 88;
  16. server_name 120.46.159.163;
  17. # ssl_certificate /home/nginx/html/dms/ssl/www.dljpwx.com.crt;
  18. # ssl_certificate_key /home/nginx/html/dms/ssl/www.dljpwx.com.key;
  19. # ssl_session_cache shared:SSL:1m;
  20. # ssl_ciphers HIGH:!aNULL:!MD5;
  21. # ssl_prefer_server_ciphers on;
  22. location / {
  23. root /home/nginx/html/dms/app;
  24. try_files $uri $uri/ /index.html;
  25. index index.html index.htm;
  26. }
  27. location /ezhizao-dms-sys/{
  28. proxy_set_header Host $http_host;
  29. proxy_set_header X-Real-IP $remote_addr;
  30. proxy_set_header REMOTE-HOST $remote_addr;
  31. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  32. proxy_pass http://120.46.159.163:7001/;
  33. }
  34. location /ezhizao-dms-p2/{
  35. proxy_set_header Host $http_host;
  36. proxy_set_header X-Real-IP $remote_addr;
  37. proxy_set_header REMOTE-HOST $remote_addr;
  38. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  39. proxy_pass http://120.46.159.163:7002/;
  40. }
  41. location /ezhizao-dms-production/{
  42. proxy_set_header Host $http_host;
  43. proxy_set_header X-Real-IP $remote_addr;
  44. proxy_set_header REMOTE-HOST $remote_addr;
  45. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  46. proxy_pass http://120.46.159.163:7003/;
  47. }
  48. location /ezhizao-dms-app/{
  49. proxy_set_header Host $http_host;
  50. proxy_set_header X-Real-IP $remote_addr;
  51. proxy_set_header REMOTE-HOST $remote_addr;
  52. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  53. proxy_pass http://120.46.159.163:7004/;
  54. }
  55. error_page 500 502 503 504 /50x.html;
  56. location = /50x.html {
  57. root html;
  58. }
  59. }
  60. # 德迈仕H5
  61. server {
  62. listen 443 ssl;
  63. server_name 120.46.159.163;
  64. ssl_certificate /home/nginx/html/dms/ssl/dms120.crt;
  65. ssl_certificate_key /home/nginx/html/dms/ssl/dms120.key;
  66. ssl_session_cache shared:SSL:1m;
  67. ssl_ciphers HIGH:!aNULL:!MD5;
  68. ssl_prefer_server_ciphers on;
  69. location / {
  70. root /home/nginx/html/dms/app;
  71. try_files $uri $uri/ /index.html;
  72. index index.html index.htm;
  73. }
  74. location /ezhizao-dms-sys/{
  75. proxy_set_header Host $http_host;
  76. proxy_set_header X-Real-IP $remote_addr;
  77. proxy_set_header REMOTE-HOST $remote_addr;
  78. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  79. proxy_pass http://120.46.159.163:7001/;
  80. }
  81. location /prod-api/{
  82. proxy_set_header Host $http_host;
  83. proxy_set_header X-Real-IP $remote_addr;
  84. proxy_set_header REMOTE-HOST $remote_addr;
  85. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  86. proxy_pass http://120.46.159.163:7004/;
  87. }
  88. location /ezhizao-dms-production/{
  89. proxy_set_header Host $http_host;
  90. proxy_set_header X-Real-IP $remote_addr;
  91. proxy_set_header REMOTE-HOST $remote_addr;
  92. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  93. proxy_pass http://120.46.159.163:7003/;
  94. }
  95. location /ezhizao-dms-p2/{
  96. proxy_set_header Host $http_host;
  97. proxy_set_header X-Real-IP $remote_addr;
  98. proxy_set_header REMOTE-HOST $remote_addr;
  99. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  100. proxy_pass http://120.46.159.163:7002/;
  101. }
  102. error_page 500 502 503 504 /50x.html;
  103. location = /50x.html {
  104. root html;
  105. }
  106. }
  107. server {
  108. listen 80;
  109. server_name 120.46.159.163;
  110. # ssl_certificate /home/nginx/html/dms/ssl/www.dljpwx.com.crt;
  111. # ssl_certificate_key /home/nginx/html/dms/ssl/www.dljpwx.com.key;
  112. # ssl_session_cache shared:SSL:1m;
  113. # ssl_ciphers HIGH:!aNULL:!MD5;
  114. # ssl_prefer_server_ciphers on;
  115. location / {
  116. root /home/nginx/html/dms/dist;
  117. try_files $uri $uri/ /index.html;
  118. index index.html index.htm;
  119. }
  120. location /ezhizao-dms-sys/{
  121. proxy_set_header Host $http_host;
  122. proxy_set_header X-Real-IP $remote_addr;
  123. proxy_set_header REMOTE-HOST $remote_addr;
  124. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  125. proxy_pass http://120.46.159.163:7001/;
  126. }
  127. location /ezhizao-dms-p2/{
  128. proxy_set_header Host $http_host;
  129. proxy_set_header X-Real-IP $remote_addr;
  130. proxy_set_header REMOTE-HOST $remote_addr;
  131. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  132. proxy_pass http://120.46.159.163:7002/;
  133. }
  134. location /ezhizao-dms-production/{
  135. proxy_set_header Host $http_host;
  136. proxy_set_header X-Real-IP $remote_addr;
  137. proxy_set_header REMOTE-HOST $remote_addr;
  138. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  139. proxy_pass http://120.46.159.163:7003/;
  140. }
  141. location /ezhizao-dms-app/{
  142. proxy_set_header Host $http_host;
  143. proxy_set_header X-Real-IP $remote_addr;
  144. proxy_set_header REMOTE-HOST $remote_addr;
  145. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  146. proxy_pass http://120.46.159.163:7004/;
  147. }
  148. location /ws-sys/ {
  149. proxy_http_version 1.1; # WebSocket 需要 HTTP/1.1
  150. proxy_set_header Upgrade $http_upgrade; # 传递 Upgrade 头
  151. proxy_set_header Connection "upgrade"; # 传递 Connection 头
  152. proxy_set_header Host $http_host;
  153. proxy_set_header X-Real-IP $remote_addr;
  154. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  155. proxy_pass http://120.46.159.163:7001/wsMessage/;
  156. }
  157. location /ws-production/ {
  158. proxy_http_version 1.1; # WebSocket 需要 HTTP/1.1
  159. proxy_set_header Upgrade $http_upgrade; # 传递 Upgrade 头
  160. proxy_set_header Connection "upgrade"; # 传递 Connection 头
  161. proxy_set_header Host $http_host;
  162. proxy_set_header X-Real-IP $remote_addr;
  163. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  164. proxy_pass http://120.46.159.163:7001/wsExport/;
  165. }
  166. error_page 500 502 503 504 /50x.html;
  167. location = /50x.html {
  168. root html;
  169. }
  170. }
  171. }