時間:2023-01-31 14:32:01 | 來源:建站知識
時間:2023-01-31 14:32:01 來源:建站知識
接上篇文章find / -name nginx.conf
2 打開這個目錄。vim /etc/nginx/nginx.conf
插入以下# 包含所有的虛擬主機(jī)的配置文件include /etc/nginx/vhosts/*.conf;
保存退出mkdir /etc/nginx/vhosts
4 創(chuàng)建名字為 www.test.com.conf 文件。并復(fù)制以下內(nèi)容進(jìn)去server { listen 80; server_name www.test.com; location / { root /usr/share/nginx/html/www.test.com/; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html/www.test.com; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/www.test.com/$fastcgi_script_name; include fastcgi_params; } location ~ /.ht { deny all; }}
service nginx restart
<?phpecho "test";?>
關(guān)鍵詞:
客戶&案例
營銷資訊
關(guān)于我們
微信公眾號
版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。