78 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
|  upstream partner_backend {
 | |
|         server 127.0.0.1:8060;
 | |
|         server 172.24.16.7:8060;
 | |
|         #check interval=5000 rise=2 fall=5 timeout=1000;
 | |
|     }
 | |
| 
 | |
| server {
 | |
|  #SSL 默认访问端口号为 443
 | |
|  listen 443 ssl;
 | |
|  #请填写绑定证书的域名
 | |
|  server_name partner.deeplink.media;
 | |
|  #请填写证书文件的相对路径或绝对路径
 | |
|  ssl_certificate  /data/tengine/conf/certificate/deeplink.media_bundle.crt;
 | |
|  #请填写私钥文件的相对路径或绝对路径
 | |
|  ssl_certificate_key /data/tengine/conf/certificate/deeplink.media.key;
 | |
|  ssl_session_timeout 5m;
 | |
|  #请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
 | |
|  ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
 | |
|  #请按照以下协议配置
 | |
|  ssl_protocols TLSv1.2 TLSv1.3;
 | |
|  ssl_prefer_server_ciphers on;
 | |
|  location / {
 | |
|    #网站主页路径。此路径仅供参考,具体请您按照实际目录操作。 
 | |
|    #例如,您的网站主页在 Nginx 服务器的 /etc/www 目录下,则请修改 root 后面的 html 为 /etc/www。
 | |
|    
 | |
|    root   /data/tengine/html/fly_moon_merchant_saas/dist;
 | |
|    index  index.html index.htm;
 | |
|  }
 | |
| 
 | |
| # 处理 /sse 请求
 | |
|  location ~ ^/(sit|test|prod)-api/sse(/.*)?$ {
 | |
|    rewrite ^/(sit|test|prod)-api/sse(/.*)?$ /sse$2 break;
 | |
|    proxy_pass         http://127.0.0.1:8040;
 | |
|    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_redirect     off;
 | |
| 
 | |
|    # 增加 SSE 相关配置
 | |
|    proxy_buffering off;  # 禁用代理缓冲
 | |
|    proxy_cache off;      # 禁用代理缓存
 | |
|    proxy_http_version 1.1;  # 使用 HTTP/1.1
 | |
|    proxy_set_header Connection '';  # 清除 Connection 头部
 | |
|    chunked_transfer_encoding on;  # 启用分块传输编码
 | |
|    proxy_read_timeout 86400s;  # 设置长时间的读取超时时间
 | |
|  }
 | |
| 
 | |
|  
 | |
|  location ~ ^/prod-api/(?!sse/).* {
 | |
|    client_max_body_size 300m;
 | |
|    proxy_pass   http://partner_backend;
 | |
|    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 3s;
 | |
|    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
 | |
| 
 | |
|  }
 | |
| 
 | |
|  location ~ ^/test-api/(?!sse/).* {
 | |
|    client_max_body_size 300m;
 | |
|    proxy_pass   http://127.0.0.1:8070;
 | |
|    proxy_set_header Host $host;
 | |
|    proxy_set_header X-Real-IP $remote_addr;
 | |
|    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | |
|  }
 | |
| 
 | |
| }
 | |
| server {
 | |
|  listen 80;
 | |
|  #请填写绑定证书的域名
 | |
|  server_name partner.deeplink.media;
 | |
|  #把http的域名请求转成https
 | |
|  return 301 https://$host$request_uri;
 | |
| }
 | |
| 
 |