You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.3 KiB

  1. worker_processes 1;
  2. syslog local6 nginx;
  3. events {
  4. worker_connections 1024;
  5. }
  6. http {
  7. include mime.types;
  8. default_type application/octet-stream;
  9. log_format main '$remote_addr - $remote_user [$time_local] $request '
  10. '"$status" $body_bytes_sent "$http_referer" '
  11. '"$http_user_agent" "$http_x_forwarded_for"';
  12. server {
  13. listen 80;
  14. server_name localhost;
  15. #send the log to syslog and file.
  16. access_log syslog:notice|logs/host1.access.log main;
  17. # pre 1.5.x
  18. error_log syslog:notice|logs/host1.error.log;
  19. location / {
  20. root html;
  21. index index.html index.htm;
  22. }
  23. }
  24. server {
  25. listen 80;
  26. server_name www.example.com;
  27. access_log syslog:warn|logs/host2.access.log main;
  28. error_log syslog:warn|logs/host2.error.log;
  29. location / {
  30. root html;
  31. index index.html index.htm;
  32. }
  33. }
  34. server {
  35. listen 80;
  36. server_name www.test.com;
  37. #send the log just to syslog.
  38. access_log syslog:error main;
  39. error_log syslog:error;
  40. location / {
  41. root html;
  42. index index.html index.htm;
  43. }
  44. }
  45. }