nginx.conf 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. upstream server {
  11. server 172.30.0.60:8080;
  12. server 172.30.0.61:8080;
  13. }
  14. server {
  15. listen 80;
  16. server_name localhost;
  17. location / {
  18. root /usr/share/nginx/html;
  19. try_files $uri $uri/ /index.html;
  20. index index.html index.htm;
  21. }
  22. location /prod-api/ {
  23. proxy_set_header Host $http_host;
  24. proxy_set_header X-Real-IP $remote_addr;
  25. proxy_set_header REMOTE-HOST $remote_addr;
  26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  27. proxy_pass http://server/;
  28. }
  29. location /admin/ {
  30. proxy_set_header Host $http_host;
  31. proxy_set_header X-Real-IP $remote_addr;
  32. proxy_set_header REMOTE-HOST $remote_addr;
  33. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  34. proxy_pass http://server/admin/;
  35. }
  36. error_page 500 502 503 504 /50x.html;
  37. location = /50x.html {
  38. root html;
  39. }
  40. }
  41. }