我在ubuntu上搭建lnmp環境,在配置nginx的時候有個小問題。
在/etc/nginx/sites-available/建立一個test檔案
server {
listen 9090;
#listen [ test.com;
large_client_header_buffers 4 16k;
client_max_body_size 300m;# _timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
)
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_wroot_size 6 #index index.html index.php;
index index .html index.htm index.php;
location / {
try_files $uri $uri/ =404;#
# location ~ \.php$ {
# include snippets/fastcgi-php.conf;
## c ):#
fastcgi_pass unix:/var/ run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
##1s # #location ~ /\.ht {
#location ~ /\.ht {
# deny all;
#}## T_FILENAME $document_root$fastcgi_script_name;
訪問127.0.0.1:9090/index.php,會報GET http://127.0.0.1:9090/index.php net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
在nginx的error.log日誌中有
2020/01/31 17:11:55 [error] 15569#15569: *6 upstream timed out (110: Connection timed out) while reading upstream , client: 127.0.0.1, server: test.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock: ", host: "127.0.0.1:9090"