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; } } }
