Files
income_payments_management/nginxConfig/prod/nginx.conf
T
2024-07-02 14:13:01 +08:00

344 lines
10 KiB
Nginx Configuration File

#user nobody;
worker_processes 2;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
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;
log_format access-upstream '$time_iso8601|$request|$remote_addr|$upstream_response_time|$http_user_agent|$http_x_forwarded_for';
map $time_iso8601 $logdate {
'~^(?<ymd>\d{4}-\d{2}-\d{2})' $ymd;
default 'date-not-found';
}
access_log logs/access-$logdate.log ;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 1000s;
proxy_read_timeout 1000s;
client_max_body_size 100m;
#gzip on;
# 企业端
server {
listen 80;
server_name cwp.catarc.org.cn www.cwp.catarc.org.cn;
#证书
listen 443 ssl;
ssl_certificate D:\income_payments\SSL\Nginx\cwp.catarc.org.cn_bundle.pem;
ssl_certificate_key D:\income_payments\SSL\Nginx\cwp.catarc.org.cn.key;
# listen 80;
# gzip config
gzip on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/income_payments/UI_enterprise/enterprise;
index index.html index.htm;
try_files $uri $uri/ /index.html;
proxy_read_timeout 150s;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header 'Referrer-Policy' 'origin';
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
}
location /jero-boot {
proxy_pass http://localhost:8077;
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 /jero-boot/actuator {
return 403;
}
#会员系统的后端
location /memberApi {
proxy_pass http://localhost:7009/api;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#拦截 getcorsfile 接口
location /preview/getCorsFile {
return 403;
}
#拦截 deletefile 接口
location /preview/deleteFile {
return 403;
}
#防止 kkfile 执行恶意代码
location /preview/index {
return 403;
}
#拦截 deletefile 接口
#通过 preview 接口允许访问 kkfile 预览
location /preview {
proxy_pass http://127.0.0.1:8092;
proxy_set_header host $host;
proxy_set_header x-real-ip $remote_addr;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
error_page 404 /404.html;
error_page 403 =404 /404.html;
location = /50x.html {
root html;
}
}
# 管理端
server {
listen 8066;
server_name cwp.catarc.org.cn www.cwp.catarc.org.cn;
# listen 80;
# gzip config
gzip on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/income_payments/UI/dist;
#try_files $uri $uri/ /index.html;
#proxy_read_timeout 150;
proxy_connect_timeout 120000s; #nginx跟后端服务器连接超时时间(代理连接超时)
proxy_send_timeout 120000s; #后端服务器数据回传时间(代理发送超时)
proxy_read_timeout 120000s; #连接成功后,后端服务器响应时间(代理接收超时)
index index.html index.htm;
# root html;
# index index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
location /jero-boot {
proxy_pass http://localhost:8077;
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 /jero-boot/actuator {
return 403;
}
# 请求大屏客户环境
location /zxd {
proxy_pass http://www.catarc.org.cn:8088;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#请求WP29客户环境
location /WPApi {
proxy_pass http://www.catarc.org.cn:20045/wp29/back;
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 /ISO {
proxy_pass http://www.catarc.org.cn:20046/iso/back;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
error_page 404 /404.html;
error_page 403 =404 /404.html;
location = /50x.html {
root html;
}
}
server {
listen 7008;
server_name casa.catarc.org.cn;
#server_name cwp.catarc.org.cn www.cwp.catarc.org.cn;
# listen 80;
# gzip config
gzip on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/standards_association/dist_vip;
#try_files $uri $uri/ /index.html;
proxy_read_timeout 150;
index index.html index.htm;
# root html;
# index index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
location /api {
proxy_pass http://localhost:7009;
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 /jero-boot {
proxy_pass http://localhost:8077;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
error_page 404 /404.html;
error_page 403 =404 /404.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name casa.catarc.org.cn;
#server_name cwp.catarc.org.cn www.cwp.catarc.org.cn;
# listen 80;
# gzip config
gzip on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/standards_association/dist;
#try_files $uri $uri/ /index.html;
proxy_read_timeout 150;
index index.html index.htm;
# root html;
# index index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=$1 last;
break;
}
}
location /api {
proxy_pass http://localhost:7009;
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 /jero-boot {
proxy_pass http://localhost:8077;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
error_page 404 /404.html;
error_page 403 =404 /404.html;
location = /50x.html {
root html;
}
}
server {
listen 8093;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location ^~ /getCorsFile {
return 404;
index index.html index.htm;
}
location /preview/getCorsFile {
return 403;
}
#拦截 deletefile 接口
location /preview/deleteFile {
return 403;
}
#防止 kkfile 执行恶意代码
location /preview/index {
return 403;
}
#拦截 deletefile 接口
location /index {
return 403;
}
}
}