部署靜態頁面到nginx


1.將頁面上傳到某個位置。比如:/home/myapp/navi


2.更改配置文件。/usr/local/nginx/conf 下的nginx.conf

   
  
 server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
           # root   html;
           # index  index.html index.htm;
             root  /home/myapp/navi;
             index PersonalNavi.html;

        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }




發佈了64 篇原創文章 · 獲贊 57 · 訪問量 14萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章