Open huoxiangdong opened 6 years ago
/etc/nginx/nginx.conf
------------------------------
http {
server {
listen 80;
listen 443;
server_name www.v2ex.com;
ssl on;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
root /usr/share/nginx/html;
index index.html;
}
location /api/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://www.v2ex.com/api/;
}
}
}
jsonp
跨域nginx
反向代理node.js
中间件代理跨域http header
cors