伪静态:
#允许跨域,可选项,nginx设置过以后注意swoole响应头中不需要再设置
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
location / {
#不记录options请求
if ($request_method = 'OPTIONS') {
access_log off;
return 204;
}
proxy_pass http://127.0.0.1:19508; #改为你的swoole服务器地址
# 将客户端的 Host 和 IP 信息一并转发到对应节点
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
#屏蔽/favicon.ico
location = /favicon.ico {
return 404;
expires 300d;
log_not_found off;
access_log off;
}
无论从事什么行业,只要做好两件事就够了,一个是你的专业、一个是你的人品,专业决定了你的存在,人品决定了你的人脉,剩下的就是坚持,用善良專業和真诚赢取更多的信任。