nginx.conf 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. server {
  2. listen 8083;
  3. server_name crowd.mooctest.net;
  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. proxy_buffering on;
  10. # 响应头的缓冲区
  11. proxy_buffer_size 128k;
  12. # 网页内容缓冲区的个数为4,单个大小为1M
  13. proxy_buffers 8 1M;
  14. proxy_busy_buffers_size 2M;
  15. location / {
  16. root /usr/share/nginx/html;
  17. }
  18. location /api {
  19. proxy_set_header Host $host;
  20. proxy_set_header X-Real-IP $remote_addr;
  21. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  22. proxy_pass http://backend:8080;
  23. proxy_connect_timeout 1200s;
  24. proxy_read_timeout 1200s;
  25. proxy_send_timeout 1200s;
  26. }
  27. location /page {
  28. proxy_pass http://crowd_user:8081;
  29. }
  30. location ~ ^/(js|vendor|css|fonts|images)/.*$ {
  31. proxy_pass http://crowd_user:8081;
  32. }
  33. #error_page 404 /404.html;
  34. # redirect server error pages to the static page /50x.html
  35. #
  36. error_page 500 502 503 504 /50x.html;
  37. location = /50x.html {
  38. root html;
  39. }
  40. }