nginx.conf 985 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. server {
  11. listen 80;
  12. server_name localhost;
  13. location / {
  14. root /home/ruoyi/projects/ruoyi-ui;
  15. try_files $uri $uri/ /index.html;
  16. index index.html index.htm;
  17. }
  18. location /prod-api/{
  19. proxy_set_header Host $http_host;
  20. proxy_set_header X-Real-IP $remote_addr;
  21. proxy_set_header REMOTE-HOST $remote_addr;
  22. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  23. proxy_pass http://ruoyi-gateway:8080/;
  24. }
  25. # 避免actuator暴露
  26. if ($request_uri ~ "/actuator") {
  27. return 403;
  28. }
  29. error_page 500 502 503 504 /50x.html;
  30. location = /50x.html {
  31. root html;
  32. }
  33. }
  34. }