nginx反向代理,跨域处理配置


nginx修改配置nginx.config实现跨域请求

worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server {//跨域请求url listen 8082; server_name 10.9.1.179; default_type 'text/html'; charset utf-8; location / { root html; index getstep.html index.html index.htm; } location /api/ {//项目原请求路径,api是项目请求资源根目录 proxy_pass http://10.9.1.179:8071; } error_page 500 502 503 504  /50x.html; location = /50x.html { root html; } } }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM