Ant Design Pro nginx配置

2020-01-13 21:56:45

Ant Design Pro nginx配置

今天看了下Ant和nginx的配置 给大家分享下

下边的配置可以直接使用 修改为自己的域名和文件夹目录就可以

server {
    server_name  www.test.com;#域名
    root G:/dist;        #文件夹路径

    location / {
        # 用于配合 browserHistory使用
        try_files $uri $uri/ /index.html;

        # 如果有资源,建议使用 https + http2,配合按需加载可以获得更好的体验 
        # rewrite ^/(.*)$ https://preview.pro.ant.design/$1 permanent;

    }
    
    location /api {
        #反向代理 如果请求的是api就代理到https://preview.pro.ant.design
        #修改为自己api的域名 
        proxy_pass https://preview.pro.ant.design;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_set_header   Host              $http_host;
        proxy_set_header   X-Real-IP         $remote_addr;
    }
}

有木有很简单~!  Ant脚手架真心方便了~~~

Ant Design Pro nginx配置


  • 2017-02-24 16:53:58

    PHP 中的Closure

    Closure,匿名函数,又称为Anonymous functions,是php5.3的时候引入的。匿名函数就是没有定义名字的函数。这点牢牢记住就能理解匿名函数的定义了。

  • 2017-03-02 09:45:27

    动态加载js和css

    开发过程中经常需要动态加载js和css,今天特意总结了一下常用的方法。