部署静态页面到nginx

时间:2022-10-01 21:47:21

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;
        }