nginx.conf 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. user nginx;
  2. worker_processes auto;
  3. error_log /var/log/nginx/error.log notice;
  4. pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 1024;
  7. }
  8. http {
  9. include /etc/nginx/mime.types;
  10. default_type application/octet-stream;
  11. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  12. '$status $body_bytes_sent "$http_referer" '
  13. '"$http_user_agent" "$http_x_forwarded_for"';
  14. access_log /var/log/nginx/access.log main;
  15. sendfile on;
  16. #tcp_nopush on;
  17. keepalive_timeout 65;
  18. #gzip on;
  19. include /etc/nginx/conf.d/*.conf;
  20. }
  21. / # ls /etc/nginx/conf.d/
  22. default.conf
  23. / # cat /etc/nginx/conf.d/default.conf
  24. server {
  25. listen 80;
  26. server_name localhost;
  27. #access_log /var/log/nginx/host.access.log main;
  28. location / {
  29. root /usr/share/nginx/html;
  30. #index index.html index.htm;
  31. try_files $uri /index.html;
  32. }
  33. #error_page 404 /404.html;
  34. # redirect server error pages to the static page /50x.html
  35. #
  36. error_page 500 502 503 504 /50x.html;
  37. location = /50x.html {
  38. root /usr/share/nginx/html;
  39. }
  40. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  41. #
  42. #location ~ \.php$ {
  43. # proxy_pass http://127.0.0.1;
  44. #}
  45. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  46. #
  47. #location ~ \.php$ {
  48. # root html;
  49. # fastcgi_pass 127.0.0.1:9000;
  50. # fastcgi_index index.php;
  51. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  52. # include fastcgi_params;
  53. #}
  54. # deny access to .htaccess files, if Apache's document root
  55. # concurs with nginx's one
  56. #
  57. #location ~ /\.ht {
  58. # deny all;
  59. #}
  60. }