user root;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
location / {
root /home/html/www/dist;
index login.html index.html;
}
location ^~ /im_client {
root /home/html/www/dist;
index im_client.html;
try_files $uri $uri/ /im_client.html;
}
location ^~ /vi/css/apiChart { //代理
proxy_pass http://172.****;
rewrite /v1/css/apiChart / break; //代理删除baseurl
}
location ^~ /v1/ccs {
proxy_pass http://172.*****;
client_max_body_size 100m;
}
location ^~ /p_socket { //socket链接的配置
proxy_pass http://172.****;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server { //多个服务
listen 8888;
location / {
root /home/p_sdk;
index index.html;
}
}
}
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream pigeon {
ip_hash;
server 172.16.41**:8008;
#server 172.16.40.**:8008;
}
upstream socket {
ip_hash;
server 172.16**:3001;
#server 172.16.4**.220:3001;
}
server {
listen 80;
location / {
proxy_pass http://pigeon;
}
location ^~ /_socket {
proxy_pass http://socket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
listen 8008;
location / {
root /home
index index.html;
try_files $uri $uri/ /index.html;
}
location ^~ /it {
root /home;
index index.html;
try_files $uri $uri/ index.html;
}
location ^~ /_api {
proxy_pass http://***:807/;
}
}
server {
listen 8888;
location / {
root /home;
index index.html;
}
}
server {
listen 9999;
location / {
root /home;
index index.html;
}
}
}