default.conf 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. upstream backed_server {
  2. server 192.168.6.251:8080 max_fails=1 fail_timeout=10s;
  3. server 192.168.3.251:8080 max_fails=1 fail_timeout=10s;
  4. }
  5. server {
  6. listen 80;
  7. server_name localhost;
  8. #charset koi8-r;
  9. access_log /var/log/nginx/host.access.log main;
  10. gzip on;
  11. gzip_min_length 1k;
  12. gzip_buffers 4 16k;
  13. gzip_comp_level 8;
  14. gzip_types text/plain application/javascript application/x-javascript text/css application/json text/javascript application/x-httpd-php image/jpeg image/gif image/png;
  15. gzip_vary off;
  16. gzip_disable "MSIE [1-6]\.";
  17. location / {
  18. root /usr/share/nginx/html;
  19. try_files $uri $uri/ /index.html;
  20. index start.html index.html;
  21. }
  22. location /api {
  23. proxy_read_timeout 300;
  24. proxy_pass http://backed_server;
  25. }
  26. location /ws {
  27. proxy_read_timeout 300;
  28. proxy_pass http://backed_server;
  29. }
  30. # location /api {
  31. # proxy_read_timeout 300;
  32. # proxy_pass http://192.168.3.177:8080;
  33. # }
  34. # location /ws {
  35. # proxy_read_timeout 300;
  36. # proxy_pass http://192.168.3.177:8080/ws;
  37. # }
  38. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  39. # location /api {
  40. # proxy_pass http://api-server:8082;
  41. # }
  42. }