【nginx】虚拟主机配置

xiaoxiao2021-02-28  37

server { listen 80; server_name www.shop.com; location / { index index.html; root html/shop; } location ~ \.php$ { root html/shop; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }

测试:在根目录/usr/local/nginx/html/shop下创建index.html

在浏览器地址栏输入www.shop.com后,回车

转载请注明原文地址: https://www.6miu.com/read-2622859.html

最新回复(0)