Nginx是一个高性能的HTTP和反向代理服务器,特点是占有内存小,并发能力强。可以支持50000个并发连接数。
1.nginx.conf(所在位置usr/local/nginx/nginx.conf)
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
gzip on;
keepalive_timeout 5000;
include /confs/*.conf;
}
2.web.conf
server {
listen 8080;
server_name localhost;
location / {
root E:/tool/pc/html;
index index.html index.htm;
}
location /api {
proxy_pass http://127.0.0.1:18080/score_server/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Fo