Nginx http服务相关的配置文件

Nginx http服务配置文件有很多需要我们掌握的命令,下面我们就来详细的看看有关的问题如何才能解决。只有不断的学习才能更好的掌握有关的Nginx http服务配置的技巧。

  1. user www www;  
  2. worker_processes 5;  
  3. error_log /var/nginx/logs/error.log;  
  4. #error_log logs/error.log notice;  
  5. #error_log logs/error.log info;  
  6. pid /var/nginx/nginx.pid;  
  7. events {  
  8. use epoll;  
  9. worker_connections 1024;  
  10. }  
  11. http {  
  12. include mime.types;  
  13. default_type application/octet-stream;  
  14. root /var/www/htdocs/;  
  15. log_format main '$remote_addr - $remote_user [$time_local] $request '  
  16. '"$status" $body_bytes_sent "$http_referer" '  
  17. '"$http_user_agent" "$http_x_forwarded_for"';  
  18. access_log /var/nginx/logs/access.log main;  
  19. sendfile on;  
  20. tcp_nopush on;  
  21. #keepalive_timeout 0;  
  22. keepalive_timeout 65;  
  23. gzip on;  
  24. server {  
  25. listen 80;  
  26. server_name localhost;  
  27. #charset koi8-r;  
  28. access_log /var/nginx/logs/host.access.log main;  
  29. location / {  
  30. root /var/www/htdocs/;  
  31. index index.html index.htm index.php;  
  32. }  
  33. error_page 404 /404.html;  
  34. error_page 500 502 503 504 /50x.html;  
  35. location = /50x.html {  
  36. root /var/www/htdocs;  
  37. }  
  38. location ~ /.php$ {  
  39. root html;  
  40. fastcgi_pass 127.0.0.1:10005;  
  41. fastcgi_index index.php;  
  42. fastcgi_param SCRIPT_FILENAME /var/www/htdocs/$fastcgi_script_name;  
  43. include fastcgi_params;  
  44. }  
  45. location ~ //.ht {  
  46. deny all;  
  47. }  
  48. }  

以上就是对Nginx http服务的详细介绍,希望大家有所收获。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值