zoukankan      html  css  js  c++  java
  • nginx 静态服务器设置

    一、配置Nginx

    [root@VM_16_15_centos nginx]# cd conf.d/
    [root@VM_16_15_centos conf.d]# ll
    total 4
    -rwxr-xr-x 1 root root 693 Mar  7 13:48 image.conf
    [root@VM_16_15_centos conf.d]# vim image.conf
    server {
            listen 80;
            server_name img.intebox.com;
            root /mnt/ipower365/apache-tomcat7/webapps;
    
           location ~  ^/img/imgs/roomRegister/(.*).(jpg|jpeg|png|bmp|swf)$ {
                    add_header content-type "image/png";
                    alias /mnt/ipower365/apache-tomcat7/webapps/img/imgs/roomRegister/$1;
             }
    
           location ~ ^/img/imgs/roomRegister/ {
                    add_header content-type "image/png";
    
            }
    
           location ~ .*.(jpg|jpeg|gif|png|bmp|webp)$ {
                    root /mnt/ipower365/apache-tomcat7/webapps;
            }
           location /img {
                    root /mnt/ipower365/apache-tomcat7/webapps;
            }
    }
    

     二、配置NFS

    1、在img.intebox.com服务器vi  /etc/exports
    #sassbill10
    /mnt/ipower365/apache-tomcat7/webapps/img 172.17.0.11(rw,sync,no_root_squash)
    2、在客户端/etc/hosts中添加 10.168.229.169 img.intebox.com
    3、[client]yum install nfs-utils rpcbind
    4、[service]service nfs restart(重启)
    5、[client]/etc/init.d/rpcbind start
    6、[client]mount -t nfs  img.intebox.com:/mnt/ipower365/apache-tomcat-7.0.55/webapps/img /mnt/ipower365/img
  • 相关阅读:
    Jenkins常用插件
    Jenkins安装配置简单使用
    Django简单快速实现PUT、DELETE方法
    Django admin有用的自定义功能
    ambari快速安装hadoop
    Asp.Net Core 3.0的依赖注入改变
    NCoreCoder.Aop 国庆更新
    NCoreCoder.Aop详解
    .Net Core 3.0下AOP试水~~
    .Net Core 3.0依赖注入替换 Autofac
  • 原文地址:https://www.cnblogs.com/zhangqigao/p/8559431.html
Copyright © 2011-2022 走看看