jecloud添加前缀
本次测试案例前缀为:ctgrpippms2.0
配置文件参考文档
server {
listen 80;
server_name 127.0.0.1;
charset utf-8;
location = /ctgrpippms2.0/{
root /data/application/openresty/nginx/jecloud;
index index.html;
}
location /ctgrpippms2.0/je {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS,HEAD,PUT,DELETE;
proxy_pass http://ip:3050/je;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
client_max_body_size 500m;
client_body_buffer_size 256k;
proxy_connect_timeout 1;
proxy_send_timeout 30;
proxy_read_timeout 60;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
}
location /ctgrpippms2.0/micro{
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS,HEAD,PUT,DELETE;
rewrite ^/(.*) /$1/index.html last;
}
location /ctgrpippms2.0/app{
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS,HEAD,PUT,DELETE;
rewrite ^/(.*) /$1/index.html last;
}
location ~ .*\.(wav|xml|js|css|ico|png|jpg|eot|svg|ttf|woff|json|html|js|css|ico|png|jpg|gif|eot|svg|ttf|woff|json|txt|ico|mp4|gz) {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS,HEAD,PUT,DELETE;
root /data/application/openresty/nginx/jecloud/;
proxy_send_timeout 1000;
proxy_read_timeout 1000;
proxy_buffer_size 256k;
proxy_buffers 8 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
proxy_cache_valid 200 304 12h;
proxy_cache_valid 301 302 1d;
proxy_cache_valid any 1m;
proxy_cache_key $uri$is_args$args;
expires 30d;
}
location /ctgrpippms2.0/jesocket {
proxy_redirect off;
proxy_pass http://ip:7010/jesocket; #代理socket, localhost为jesocket所在服务器ip
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_request_buffering off;
proxy_buffering off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
#proxy_set_header X-NginX-Proxy true;
}
}
最后编辑: 翟厚翔 文档更新时间: 2025-01-15 16:00 作者:翟厚翔