Sentry+nginx代理

如果想让所有的服务通过统一出口上报异常,可以使用代理模式.

一 配置本地host文件(可选)

#hosts
#ip换成代理服务器的ip地址
ip sentry-proxy.com

二 增加nginx配置

#nginx/conf/conf.d/sentry.conf
server {
        listen       80;
        server_name  sentry-proxy.com; #步骤一配置的dns,域名容易记
	
	location / {
 
           proxy_pass $外网能访问的sentry地址;
           proxy_cache_valid 200 1y;
           add_header  Nginx-Cache "$upstream_cache_status";
           proxy_ssl_session_reuse off;
           proxy_ssl_server_name on;
           proxy_ssl_name sentry.zjwlyy.cn;
           proxy_ssl_protocols TLSv1.2;
           proxy_set_header X-Real-IP $remote_addr;
		   #proxy_set_header Host $http_host;
        }
 }

三 修改sentry dsn

sentry:
  dsn: 'http://xxxx@sentry-proxy.com/x'
posted @   0更新  阅读(121)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂
点击右上角即可分享
微信分享提示