server { listen 80; server_name prejoin.chexd.com; #监听的hostname add_header 'Access-Control-Allow-Origin' '*'; root /usr/local/nginx/prejoinhtml; #第一个项目的根目录 add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET'; add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type'; index index.html; location / { try_files $uri $uri/ /index.html; proxy_set_header Host $host; } charset utf-8; location ~* /join { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header AA ddddd; proxy_pass 域名; } }
标签:set,请求,header,代理,Access,nginx,add,proxy,Allow From: https://www.cnblogs.com/chengfengchi/p/17843713.html