nginxのリバースプロキシ、クロスドメイン処理構成

設定nginx.configを変更するnginxのクロスドメインリクエスト

worker_processes   1 ; 
イベント{ 
    worker_connections   1024 
} 
HTTP { 
    のmime.typesを含みます。
    default_typeアプリケーション / octet- ストリーム。
    sendfileの上; 
    keepalive_timeout   65 ; 
    サーバー{//跨域请求urlは
        聞く        8082を
        SERVER_NAME   10.9.1.179 ;        
        default_type 'text / htmlの' ;        
        文字セットUTF -8 ; 
        位置 / { 
            ルートHTML。
            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 { 
            ルートHTML; 
        } 
    } 

}

 

おすすめ

転載: www.cnblogs.com/lazyli/p/11087915.html