location / { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; if ($request_method = 'OPTIONS') { return 204; } proxy_pass http://localhost:60877/; root html; index index.html index.htm; }
windows nginx操作
查看nginx的版本号:nginx -v
启动nginx:start nginx
快速停止或关闭nginx:nginx -s stop
正常停止或关闭nginx:nginx -s quit
配置文件nginx.conf修改重装载命令:nginx -s reload