Nginx是一个HTTP的web服务器,可以将服务器上的静态文件(如HTML、图片等)通过HTTP协议返回给浏览器客户端。我们只要配置配置location就行了

    1. listen 80;
    2. server_name 112.74.110.26;
    3. location /ace-master {
    4. root /opt/static;
    5. index index.html index.htm;
    6. }
    7. 当我们访问112.74.110.26:80/ace-master的时候,会被nginx拦截,进行location匹配。
    8. 112.74.110.26:80就是根路径/,代表linux磁盘上的/opt/static目录。
    9. 所以112.74.110.26:80/ace-master就相当于访问/opt/static/static目录下的index.html页面。

    **