溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

怎么進(jìn)行Nginx配置文件引用

發(fā)布時(shí)間:2021-11-25 15:57:55 來(lái)源:億速云 閱讀:410 作者:柒染 欄目:web開發(fā)

怎么進(jìn)行Nginx配置文件引用,針對(duì)這個(gè)問(wèn)題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問(wèn)題的小伙伴找到更簡(jiǎn)單易行的方法。

Nginx配置文件有很多需要我們注意很多問(wèn)題,其中在進(jìn)行user配置的時(shí)候就需要我們引起重視,我們?cè)诓粩嗟氖褂弥芯蜁?huì)發(fā)現(xiàn)這一點(diǎn),下面是一個(gè)簡(jiǎn)單的Nginx配置文件:

Nginx配置文件引用

  1. user www www;  

  2. worker_processes 8;  

  3. worker_cpu_affinity 00000001 00000010 00000100 00001000 
    00010000 00100000 01000000;  

  4. error_log /www/log/Nginx_error.log crit;  

  5. pid /usr/local/Nginx/Nginx.pid;  

  6. worker_rlimit_nofile 204800;  

  7. events  

  8. {  

  9. use epoll;  

  10. worker_connections 204800;  

  11. }  

  12. http  

  13. {  

  14. include mime.types;  

  15. default_type application/octet-stream;  

  16. charset utf-8;  

  17. server_names_hash_bucket_size 128;  

  18. client_header_buffer_size 2k;  

  19. large_client_header_buffers 4 4k;  

  20. client_max_body_size 8m;  

  21. sendfile on;  

  22. tcp_nopush on;  

  23. keepalive_timeout 60;  

  24. fastcgi_cache_path /usr/local/Nginx/fastcgi_cache levels=1:2  

  25. keys_zone=TEST:10m  

  26. inactive=5m;  

  27. fastcgi_connect_timeout 300;  

  28. fastcgi_send_timeout 300;  

  29. fastcgi_read_timeout 300;  

  30. fastcgi_buffer_size 4k;  

  31. fastcgi_buffers 8 4k;  

  32. fastcgi_busy_buffers_size 8k;  

  33. fastcgi_temp_file_write_size 8k;  

  34. fastcgi_cache TEST;  

  35. fastcgi_cache_valid 200 302 1h;  

  36. fastcgi_cache_valid 301 1d;   

  37. fastcgi_cache_valid any 1m;  

  38. fastcgi_cache_min_uses 1;  

  39. fastcgi_cache_use_stale error timeout invalid_header http_500;  

  40. open_file_cache max=204800 inactive=20s;  

  41. open_file_cache_min_uses 1;  

  42. open_file_cache_valid 30s;  

  43. tcp_nodelay on;  

  44. gzip on;  

  45. gzip_min_length 1k;  

  46. gzip_buffers 4 16k;  

  47. gzip_http_version 1.0;  

  48. gzip_comp_level 2;  

  49. gzip_types text/plain application/x-javascript text/css 
    application/xml;  

  50. gzip_vary on;  

  51. server  

  52. {  

  53. listen 8080;  

  54. server_name backup.aiju.com;  

  55. index index.php index.htm;  

  56. root /www/html/;  

  57. location /status  

  58. {  

  59. stub_status on;  

  60. }  

  61. location ~ .*\.(php|php5)?$  

  62. {  

  63. fastcgi_pass 127.0.0.1:9000;  

  64. fastcgi_index index.php;  

  65. include fcgi.conf;  

  66. }  

  67. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$  

  68. {  

  69. expires 30d;  

  70. }  

  71. log_format access '$remote_addr - $remote_user 
    [$time_local] "$request" '  

  72. '$status $body_bytes_sent "$http_referer" '  

  73. '"$http_user_agent" $http_x_forwarded_for';  

  74. access_log /www/log/access.log access;  

  75. }  

關(guān)于怎么進(jìn)行Nginx配置文件引用問(wèn)題的解答就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,如果你還有很多疑惑沒(méi)有解開,可以關(guān)注億速云行業(yè)資訊頻道了解更多相關(guān)知識(shí)。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI