wget http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.10.0-1.el7.ngx.x86_64.rpm
npm -ivh nginx-1.10.0-1.el7.ngx.x86_64.rpm
service nginx start|restart|stop|status #啓動|重啓|中止|狀態
rpm安裝,你會發現你找不到nginx的目錄,所以你須要去搜索,以下:html
find / -name "nginx*"
搜索結果以下所示:nginx
... /etc/nginx /etc/nginx/nginx.conf ...
使用vi進行編輯文件便可,最後重啓nginx。shell
http { ...... add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers X-Requested-With; add_header Access-Control-Allow-Methods GET,POST,OPTIONS; ...... }
將同一用戶的請求調度至後端同一臺Tomcat上,不至於一刷新就致使session丟失;npm