nginx.conf 984 B

12345678910111213141516171819202122232425262728293031
  1. server {
  2. listen 80;
  3. location / {
  4. proxy_pass http://frontend:8080;
  5. proxy_set_header Host $host;
  6. proxy_set_header X-Real-IP $remote_addr;
  7. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  8. proxy_set_header X-Forwarded-Proto $scheme;
  9. }
  10. location ^~ /api {
  11. proxy_pass http://backend:8082/;
  12. proxy_set_header Host $host;
  13. proxy_set_header X-Real-IP $remote_addr;
  14. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  15. proxy_set_header X-Forwarded-Proto $scheme;
  16. proxy_set_header REMOTE-HOST $remote_addr;
  17. proxy_http_version 1.1;
  18. add_header X-Cache $upstream_cache_status;
  19. set $static_fileTU7903MC 0;
  20. if ($uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$") {
  21. set $static_fileTU7903MC 1;
  22. expires 1m;
  23. }
  24. if ($static_fileTU7903MC = 0) {
  25. add_header Cache-Control no-cache;
  26. }
  27. }
  28. }