nginx reverse proxy, cross-domain processing configuration

nginx cross-domain request to modify the configuration 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;
            getstep.html index.html index.htm index; 
        } 
        LOCATION / API / {// item original request path, api project root resource request 
            proxy_pass HTTP: // 10.9.1.179:8071;    
        } 
        error_page    500 502 503 504 / 50X .html; 
        LOCATION = / 50x.html { 
            the root HTML; 
        } 
    } 

}

 

Guess you like

Origin www.cnblogs.com/lazyli/p/11087915.html