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'
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂