nginx.conf 694 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # cd libhv
  2. # sudo nginx -p . -c etc/nginx.conf
  3. # bin/httpd -c etc/httpd.conf -s restart -d
  4. # bin/curl -v http://127.0.0.1/api/v1/get
  5. worker_processes auto;
  6. pid logs/nginx.pid;
  7. error_log logs/error.log;
  8. events {
  9. worker_connections 1024;
  10. }
  11. http {
  12. access_log logs/access.log;
  13. server {
  14. listen 80;
  15. # static files service
  16. location / {
  17. root html;
  18. index index.html;
  19. }
  20. # autoindex service
  21. location /downloads/ {
  22. autoindex on;
  23. }
  24. # api service: nginx => libhv
  25. location /api/v1/ {
  26. proxy_pass http://127.0.0.1:8080/;
  27. }
  28. }
  29. }