zoukankan      html  css  js  c++  java
  • Nginx添加静态页面

    1.编辑配置文件

    sudo vim  /etc/nginx/nginx.conf
    

    在http {}中添加如下

    server {
                    listen       80;
                    server_name  localhost;
                    location / {
                        root   html;
                        index  index.html index.htm;
                    }
                }
    

     

    2.重启nginx

    systemctl restart nginx
    

    3.访问,成功

    localhost:80/index.html
    

     

    4.访问日志

    tail -n 100 /var/log/nginx/access.log 
    127.0.0.1 - - [12/Oct/2019:18:22:21 +0800] "GET /index.html HTTP/1.1" 200 396 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0"
    127.0.0.1 - - [12/Oct/2019:18:22:21 +0800] "GET /favicon.ico HTTP/1.1" 404 152 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0"
    127.0.0.1 - - [12/Oct/2019:18:30:37 +0800] "GET /index.html HTTP/1.1" 200 396 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0"
    127.0.0.1 - - [12/Oct/2019:18:30:37 +0800] "GET /favicon.ico HTTP/1.1" 404 152 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0"
    
  • 相关阅读:
    cvxpy 示例代码
    Cora 数据集介绍
    图嵌入
    数学建模
    邮件服务器搭建
    windows安装、使用MongoDB
    Django 特殊查询
    软件测试-软件质量
    软件测试-配置管理(7)
    软件测试-缺陷管理(6)
  • 原文地址:https://www.cnblogs.com/tonglin0325/p/11663305.html
Copyright © 2011-2022 走看看