nginx.conf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. user root;
  2. worker_processes 1;
  3. error_log /var/log/nginx/error.log warn;
  4. pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 1024;
  7. }
  8. http {
  9. include /etc/nginx/mime.types;
  10. default_type application/octet-stream;
  11. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  12. '$status $body_bytes_sent "$http_referer" '
  13. '"$http_user_agent" "$http_x_forwarded_for"';
  14. access_log /var/log/nginx/access.log main;
  15. sendfile on;
  16. #tcp_nopush on;
  17. keepalive_timeout 65;
  18. #gzip on;
  19. #include /etc/nginx/conf.d/*.conf;
  20. upstream gateway {
  21. server 172.30.0.81;
  22. server 172.30.0.82;
  23. }
  24. upstream auth {
  25. server 172.30.0.91:8100;
  26. server 172.30.0.92:8100;
  27. }
  28. server {
  29. listen 88;
  30. server_name gateway;
  31. location / {
  32. proxy_set_header Host $host;
  33. proxy_set_header X-Real-IP $remote_addr;
  34. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  35. proxy_buffering off;
  36. proxy_pass http://gateway;
  37. }
  38. if ($request_uri ~ "/actuator") {
  39. return 403;
  40. }
  41. }
  42. server {
  43. listen 9000;
  44. server_name auth;
  45. location / {
  46. proxy_set_header Host $host;
  47. proxy_set_header X-Real-IP $remote_addr;
  48. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  49. proxy_buffering off;
  50. proxy_pass http://auth;
  51. }
  52. }
  53. }