Bonus-Cloud-Houqin/scripts_10_138_55_104/20250610_add_yunjian_nginx....

145 lines
3.9 KiB
Plaintext

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
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;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
client_max_body_size 100M;
client_body_buffer_size 100M;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
#gzip on;
server {
listen 80;
server_name localhost;
charset utf-8;
location /h5pro {
# 网站根目录,此处使用容器内的路径
alias /usr/share/nginx/html/h5pro/;
# 默认首页
index index.html;
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
try_files $uri $uri/ /h5pro/index.html;
}
location /h5yz {
# 网站根目录,此处使用容器内的路径
alias /usr/share/nginx/html/h5yz/;
# 默认首页
index index.html;
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
try_files $uri $uri/ /h5yz/index.html;
}
location /glweb {
# 网站根目录,此处使用容器内的路径
alias /usr/share/nginx/html/glweb/;
# 默认首页
index index.html;
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
try_files $uri $uri/ /glweb/index.html;
}
location /gxyzweb {
# 网站根目录,此处使用容器内的路径
alias /usr/share/nginx/html/gxyzweb/;
# 默认首页
index index.html;
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
try_files $uri $uri/ /gxyzweb/index.html;
}
location /adScreen {
# 网站根目录,此处使用容器内的路径
alias /usr/share/nginx/html/adScreen/;
# 默认首页
index index.html;
# 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html
try_files $uri $uri/ /adScreen/index.html;
}
location /statics/ {
proxy_pass http://10.138.55.104:59300/statics/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /dev-api/ {
proxy_pass http://10.138.55.104:58080/; #跨域转发路由地址
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# 运检食堂
location /SDT_ZHST_APP {
alias /usr/share/nginx/html/ZHST_APP/;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /files {
#代理本地文件夹
#alias /home/lzapp/nginx/www/yjfile/;
alias /usr/share/nginx/html/yjfile/;
autoindex off;
}
location /yjst_ws/ {
proxy_pass http://10.138.55.104:58083/socket/endpointWs/;
proxy_http_version 1.1;
# 超时设置
proxy_read_timeout 36000s; # 接收超时
proxy_send_timeout 36000s; # 新增发送超时
proxy_connect_timeout 60s; # 连接超时
# WebSocket协议头
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# 保活配置
#proxy_socket_keepalive on; # 开启TCP keepalive
#proxy_headers_hash_bucket_size 128;
# 透传真实IP
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}