dev.nginx.conf 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. worker_processes 1;
  2. events {
  3. worker_connections 1024;
  4. }
  5. http {
  6. include /etc/nginx/mime.types;
  7. default_type application/octet-stream;
  8. sendfile off;
  9. keepalive_timeout 65;
  10. server {
  11. listen 80;
  12. server_name localhost;
  13. location / {
  14. proxy_set_header X-Real-IP $remote_addr;
  15. proxy_set_header X-Forwarded-For $remote_addr;
  16. proxy_set_header Host $host;
  17. proxy_http_version 1.1;
  18. proxy_set_header Upgrade $http_upgrade;
  19. proxy_set_header Connection "upgrade";
  20. proxy_redirect off;
  21. proxy_pass http://localhost:81;
  22. }
  23. location /backend {
  24. proxy_set_header X-Real-IP $remote_addr;
  25. proxy_set_header X-Forwarded-For $remote_addr;
  26. proxy_set_header Host $host;
  27. proxy_http_version 1.1;
  28. proxy_set_header Upgrade $http_upgrade;
  29. proxy_set_header Connection "upgrade";
  30. proxy_redirect off;
  31. rewrite ^/backend/?(.*) /$1 break;
  32. proxy_pass http://backend:8080;
  33. }
  34. }
  35. }