1.前提php
已安裝配置好nginx+ftp服務html
2.配置Nginx 服務器nginx
2.1進入nginx 配置文件目錄:服務器
cd /usr/local/nginx/conf網站
vi nginx.conf spa
2.2 修改配置文件:有兩種方式code
①方式一:在配置文件server{}中location /{} 修改配置server
1 #默認請求 2 location / { 3 root /home/ftpuser/www;#定義服務器的默認網站根目錄位置 4 index index.html index.php index.htm;#定義首頁索引文件的名稱 5 }
②方式二:在http{}內配置新服務 htm
1 server { 2 listen 8080; 3 server_name localhost; 4 5 #charset utf-8; 6 7 #access_log logs/host.access.log main; 8 9 #默認請求 10 location / { 11 root /home/ftpuser/www;#定義服務器的默認網站根目錄位置 12 index index.html index.php index.htm;#定義首頁索引文件的名稱 13 } 14 }
個人配置(方式一):blog