【nginx】基於ngnix的動靜分離

1.實現效果

2.準備工作

   在linux服務器/創建一個websitedata/image/qxlxi.jpg  和 websitedata/html/a.html 資源、

3.修改Nginx配置文件

    server{
        listen          80;  
        server_name     192.168.58.136;

        location /html/{
           root   /websitedata/;
           index  index.html  index.htm;
        }

        location /images/{
           root   /websitedata/;
           autoindex  on;
       }
    }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章