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-13 17:50:05

    cURL error 60: SSL certificate problem: unable to get local issuer certificate

    Drupal 8 version uses Guzzle Http Client internally, but under the hood it may use cURL or PHP internals. If you installed PHP cURL on your PHP server it typically uses cURL and you may see an exception with error Peer certificate cannot be authenticated with known CA certificates or error code CURLE_SSL_CACERT (60).

  • 2017-02-16 08:09:01

    HTML中PRE和p的区别

    pre 元素可定义预格式化的文本。被包围在 pre 元素中的文本通常会保留空格和换行符。而文本也会呈现为等宽字体。 <pre> 标签的一个常见应用就是用来表示计算机的源代码。

  • 2017-02-16 15:14:14

    动态加载js和css

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