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