gunshi-project-ss/nginx.conf

114 lines
3.2 KiB
Nginx Configuration File
Raw Permalink Normal View History

2025-12-23 17:30:33 +08:00
user root;
worker_processes auto;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" - $uri '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
types_hash_max_size 2048;
client_max_body_size 100m;
server {
listen 80;
server_name localhost;
location /gunshiApp/tsg/ {
proxy_pass http://10.142.147.46:24105/gunshiApp/tsg/;
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_connect_timeout 60s;
proxy_read_timeout 300s;
proxy_send_timeout 60s;
}
location /gunshiApp/tsg/profile {
rewrite /gunshiApp/tsg/profile/(.*) /gunshiApp/tsg/$1 last;
}
location /gunshiApp/tsg/upload {
alias /app/uploadPath/upload;
}
# 其他location规则如静态文件等
location /tsg {
root /usr/share/nginx/html;
#try_files $uri $uri/ =404;
}
# 雷达图
location /shzh/service2/shzh/met/zyqxfw/api/radar/getImgNames {
proxy_pass http://10.42.6.68:81;
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_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 60s;
}
# 气象云图
location /shzh/service2/shzh/met/zyqxfw/api/radar/sateCloud/getImgNames {
proxy_pass http://10.42.6.68:81;
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_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 60s;
}
location /gunshiApp/hsz/ {
proxy_pass http://0.0.0.0:24205/gunshiApp/hsz/;
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_connect_timeout 60s;
proxy_read_timeout 300s;
proxy_send_timeout 60s;
}
location /gunshiApp/hsz/profile {
rewrite /gunshiApp/hsz/profile/(.*)$ /gunshiApp/hsz/$1 last;
}
location /gunshiApp/hsz/upload {
alias /app/uploadPath/upload;
}
location /hsz {
root /usr/share/nginx/html;
#try_files $uri $uri/ =404;
}
location /rtutesttemp {
proxy_pass http://10.142.147.46:22205/rtutesttemp;
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_connect_timeout 60s;
proxy_read_timeout 300s;
proxy_send_timeout 60s;
}
}
include /etc/nginx/conf.d/*.conf;
}