zoukankan      html  css  js  c++  java
  • mac nginx 虚拟机配置

    myb.local.conf

    `server {
    listen 80 default_server;
    root /Users/x/web/m_api/Public;

    client_max_body_size 50m;
    location /h5/ {
        charset  utf-8;
        index index.html;
        root /Users/x/web/m_api/Public;
        try_files $uri $uri/ /h5/index.html?$query_string;
    }
    location /a/ {
        charset  utf-8;
        index index.html;
        root /Users/x/web/m_api/Public;
        try_files $uri $uri/ /a/index.html?$query_string;
    }
    
    location / {
        root /Users/x/web/m_api/Public;
        #允许跨域
        add_header 'Access-Control-Allow-Origin' $http_origin;
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 't-host,t-token,t-client';
        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
        if ($request_method = 'OPTIONS') {
                add_header 'Access-Control-Allow-Origin' $http_origin;
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 't-host,t-token,t-client';
        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
    
                return 204;
        }
        proxy_http_version 1.1;
        proxy_set_header Connection "keep-alive";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host      $host;
        if (!-f $request_filename) {
             proxy_pass http://127.0.0.1:9501;
        }
    }
    

    }`

  • 相关阅读:
    【洛谷P4318】完全平方数
    【洛谷P2257】YY的GCD
    【洛谷P1403】约数研究
    【洛谷P3455】ZAP-Queries
    【CF600E】Lomsat gelral
    【BZOJ3289】Mato的文件管理 莫队+树状数组
    【洛谷P2585】三色二叉树
    【CF242E】Xor Segment
    【洛谷P4144】大河的序列
    hdu 1547(BFS)
  • 原文地址:https://www.cnblogs.com/xielisen/p/13752489.html
Copyright © 2011-2022 走看看