server {
    listen 80;
    server_name shop-wechat.xinyuesite.com;
    charset utf-8;

    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Allow-Headers *;
    add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
    if ($request_method = 'OPTIONS') {
        return 204;
    }
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Remote_addr $remote_addr;
    proxy_set_header X-Real_IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-CROS true;  # 自定义，有做跨域的时候需要加，后端会做判断
    proxy_redirect off;
    proxy_http_version 1.1;


    location / {
        root /usr/share/nginx/html/;
        try_files $uri $uri/ /login.html;
        index login.html;
    }

}