worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
error_log logs/error.log;
sendfile on;
keepalive_timeout 65;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 500m;
limit_conn_zone $binary_remote_addr zone=one:32k;
#gzip on;
gzip on;
gzip_min_length 1k;
gzip_buffers 16 64k;
gzip_http_version 1.1;
gzip_comp_level 9;
gzip_types text/plain application/x-javascript application/javascript text/javascript text/css application/xml application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
server {
listen 80;
server_name www.xxx.cn;
#return 301 https://$server_name$request_uri;
location /static/file {
proxy_pass http://101.168.4.12:8165/static/file;
}
location / {
root /web-frames/dist;
index index.html index.htm;
}
location /apiyjxcx/api/index {
alias /var/web/h5;
index index.html;
}
location /group1/M00/ {
ngx_fastdfs_module;
}
location /api {
proxy_set_header Host $Host;
proxy_pass http://101.168.4.12:8187/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Port $Server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
location = /50x.html {
root html;
}
location ^~ /uum/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:81/uum/;
}
}
server {
listen 81 default_server;
location / {
root /home//dist;
index index.html index.htm;
}
location ^~ /uum/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:9088/;
}
location ^~ /monitor/ {
proxy_pass http://127.0.0.1:9088/;
proxy_set_header Host $host:$server_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ^~ /file/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:9088/;
}
location ^~ /source/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://10.168.4.219/;
}
}
server {
listen 9000;
server_name www.xxx.com;
location /api/b {
alias /data/b;
index b.html b.htm;
}
location /api/abc {
set $URL $scheme://$host$request_uri;
if ($URL ~ "abc"){
rewrite "^(.*)abc(.*)$" $1b$2 permanent;
}
alias /data/a;
index a.html a.htm;
}
}
}