nginx.conf 6.2 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. location /ws-sys/ {
  56. proxy_http_version 1.1; # WebSocket 需要 HTTP/1.1
  57. proxy_set_header Upgrade $http_upgrade; # 传递 Upgrade 头
  58. proxy_set_header Connection "upgrade"; # 传递 Connection 头
  59. proxy_set_header Host $host;
  60. proxy_set_header X-Real-IP $remote_addr;
  61. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  62. proxy_pass http://120.46.159.163:7001/ws/;
  63. }
  64. location /ws-production/ {
  65. proxy_http_version 1.1; # WebSocket 需要 HTTP/1.1
  66. proxy_set_header Upgrade $http_upgrade; # 传递 Upgrade 头
  67. proxy_set_header Connection "upgrade"; # 传递 Connection 头
  68. proxy_set_header Host $host;
  69. proxy_set_header X-Real-IP $remote_addr;
  70. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  71. proxy_pass http://120.46.159.163:7003/wsExport/;
  72. }
  73. error_page 500 502 503 504 /50x.html;
  74. location = /50x.html {
  75. root html;
  76. }
  77. }
  78. # 德迈仕H5
  79. server {
  80. listen 443 ssl;
  81. server_name 120.46.159.163;
  82. ssl_certificate /home/nginx/html/dms/ssl/dms120.crt;
  83. ssl_certificate_key /home/nginx/html/dms/ssl/dms120.key;
  84. ssl_session_cache shared:SSL:1m;
  85. ssl_ciphers HIGH:!aNULL:!MD5;
  86. ssl_prefer_server_ciphers on;
  87. location / {
  88. root /home/nginx/html/dms/app;
  89. try_files $uri $uri/ /index.html;
  90. index index.html index.htm;
  91. }
  92. location /ezhizao-dms-sys/{
  93. proxy_set_header Host $http_host;
  94. proxy_set_header X-Real-IP $remote_addr;
  95. proxy_set_header REMOTE-HOST $remote_addr;
  96. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  97. proxy_pass http://120.46.159.163:7001/;
  98. }
  99. location /prod-api/{
  100. proxy_set_header Host $http_host;
  101. proxy_set_header X-Real-IP $remote_addr;
  102. proxy_set_header REMOTE-HOST $remote_addr;
  103. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  104. proxy_pass http://120.46.159.163:7004/;
  105. }
  106. location /ezhizao-dms-production/{
  107. proxy_set_header Host $http_host;
  108. proxy_set_header X-Real-IP $remote_addr;
  109. proxy_set_header REMOTE-HOST $remote_addr;
  110. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  111. proxy_pass http://120.46.159.163:7003/;
  112. }
  113. location /ezhizao-dms-p2/{
  114. proxy_set_header Host $http_host;
  115. proxy_set_header X-Real-IP $remote_addr;
  116. proxy_set_header REMOTE-HOST $remote_addr;
  117. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  118. proxy_pass http://120.46.159.163:7002/;
  119. }
  120. error_page 500 502 503 504 /50x.html;
  121. location = /50x.html {
  122. root html;
  123. }
  124. }
  125. server {
  126. listen 80;
  127. server_name 120.46.159.163;
  128. # ssl_certificate /home/nginx/html/dms/ssl/www.dljpwx.com.crt;
  129. # ssl_certificate_key /home/nginx/html/dms/ssl/www.dljpwx.com.key;
  130. # ssl_session_cache shared:SSL:1m;
  131. # ssl_ciphers HIGH:!aNULL:!MD5;
  132. # ssl_prefer_server_ciphers on;
  133. location / {
  134. root /home/nginx/html/dms/dist;
  135. try_files $uri $uri/ /index.html;
  136. index index.html index.htm;
  137. }
  138. location /ezhizao-dms-sys/{
  139. proxy_set_header Host $http_host;
  140. proxy_set_header X-Real-IP $remote_addr;
  141. proxy_set_header REMOTE-HOST $remote_addr;
  142. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  143. proxy_pass http://120.46.159.163:7001/;
  144. }
  145. location /ezhizao-dms-p2/{
  146. proxy_set_header Host $http_host;
  147. proxy_set_header X-Real-IP $remote_addr;
  148. proxy_set_header REMOTE-HOST $remote_addr;
  149. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  150. proxy_pass http://120.46.159.163:7002/;
  151. }
  152. location /ezhizao-dms-production/{
  153. proxy_set_header Host $http_host;
  154. proxy_set_header X-Real-IP $remote_addr;
  155. proxy_set_header REMOTE-HOST $remote_addr;
  156. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  157. proxy_pass http://120.46.159.163:7003/;
  158. }
  159. location /ezhizao-dms-app/{
  160. proxy_set_header Host $http_host;
  161. proxy_set_header X-Real-IP $remote_addr;
  162. proxy_set_header REMOTE-HOST $remote_addr;
  163. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  164. proxy_pass http://120.46.159.163:7004/;
  165. }
  166. error_page 500 502 503 504 /50x.html;
  167. location = /50x.html {
  168. root html;
  169. }
  170. }
  171. }