zoukankan      html  css  js  c++  java
  • nginx配置之站点服务请求功能配置

    站点服务请求功能配置:html/

        nginx.conf中的http{}中的server{}:      

            server { 

              listen 85; 

              server_name localhost; 

              #charset koi8-r; 

              #access_log logs/host.access.log main; 

              #access_log "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G" main; 

              #网站的路径匹配,如同django的urls匹配,对用户的访问url进行路径分配 

              #当请求url长这样时: 

              # 192.168.16.142:85/ 就走如下location配置 

              location / { 

                #deny 参数配置禁止访问的ip 

                #deny 192.168.16.0/24; 

                #root参数是定义网页根目录的,可以修改 

                root /opt/html; 

                #index 定义网页首页名字的 

                index index.html index.htm; 

              } 

              #当用户请求url是 192.168.16.142:85/pic/monkeyKing.jpg 

              location /pic { 

                #通过alias别名参数,去这个路径下找 

                alias /opt/pic/; 

              } 

              error_page 404 /404.html; 

              # redirect server error pages to the static page /50x.html 

            }

        #网站的路径匹配,如同django的urls匹配,对用户的访问url进行路径分配

  • 相关阅读:
    提取字符串中的数字
    监控mysql执行的sql语句
    maven打包跳过单元测试
    idea常用快捷键
    spring boot 从入门到精通(一)启动项目的三种方式
    git从入门到精通(三)(git 生成本地密钥的方法:windows)
    经典面试题
    vue 20道精选面试题
    Angular输入框内按下回车会触发其它button的点击事件的解决方法
    快速搭建angular7 前端开发环境
  • 原文地址:https://www.cnblogs.com/open-yang/p/11255838.html
Copyright © 2011-2022 走看看