René's URL Explorer Experiment


Title: nginx 转发 redis · Issue #125 · codcodog/Blog · GitHub

Open Graph Title: nginx 转发 redis · Issue #125 · codcodog/Blog

X Title: nginx 转发 redis · Issue #125 · codcodog/Blog

Description: nginx 转发 redis 场景 本地开发,需要连接测试环境的 redis,但 redis 是内网的,不对外网开放. 方案 利用 nginx 进行反向代理,把请求转发到内网的 redis 上. 找到测试环境的一台 nginx,配置反向代理. 修改 nginx.conf http { ... } # 注意跟 http 同级 stream { upstream redis { server 10.8.xx.xxx:6379 max_fails=3 fail_timeout...

Open Graph Description: nginx 转发 redis 场景 本地开发,需要连接测试环境的 redis,但 redis 是内网的,不对外网开放. 方案 利用 nginx 进行反向代理,把请求转发到内网的 redis 上. 找到测试环境的一台 nginx,配置反向代理. 修改 nginx.conf http { ... } # 注意跟 http 同级 stream { upstream redis { server 1...

X Description: nginx 转发 redis 场景 本地开发,需要连接测试环境的 redis,但 redis 是内网的,不对外网开放. 方案 利用 nginx 进行反向代理,把请求转发到内网的 redis 上. 找到测试环境的一台 nginx,配置反向代理. 修改 nginx.conf http { ... } # 注意跟 http 同级 stream { upstream redis { server 1...

Opengraph URL: https://github.com/codcodog/Blog/issues/125

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"nginx 转发 redis","articleBody":"nginx 转发 redis\r\n==================\r\n\r\n### 场景\r\n\r\n本地开发,需要连接测试环境的 `redis`,但 `redis` 是内网的,不对外网开放.\r\n\r\n\r\n### 方案\r\n\r\n利用 `nginx` 进行反向代理,把请求转发到内网的 `redis` 上.  \r\n找到测试环境的一台 `nginx`,配置反向代理.\r\n\r\n修改 `nginx.conf`\r\n```\r\nhttp {\r\n    ...\r\n}\r\n\r\n# 注意跟 http 同级\r\nstream {\r\n     upstream redis {\r\n         server  10.8.xx.xxx:6379 max_fails=3 fail_timeout=30s;\r\n     }\r\n\r\n     server {\r\n          listen 16379;\r\n          proxy_connect_timeout 1s;\r\n          proxy_timeout 3s;\r\n          proxy_pass redis;\r\n     }\r\n}\r\n```\r\n\r\n如是不想修改 `nginx.conf`,而是在 `conf.d` 添加新的配置文件 `redis.conf`,则需要把 `include` 指令从 `http` 移出来  \r\n\u003e 这样保证添加的 `redis.conf` 跟 `http` 同级\r\n```\r\nhttp {\r\n    ...\r\n}\r\n\r\ninclude /etc/nginx/conf.d/*.conf\r\n```\r\n\r\n若遇到 `nginx: [emerg] unknown directive \"stream\" in /usr/local/openresty/nginx/conf/conf.d/redis.conf:1` 错误  \r\n是因为 `stream` 模块没加载到,手动加载下\r\n```\r\nload_module /usr/lib64/nginx/modules/ngx_stream_module.so;\r\n\r\nhttp {\r\n    ...\r\n}\r\n```\r\n\r\n如果不知道 `ngx_stream_module.so` 的路径在那里,则全局搜一下\r\n```\r\n$ find / -name 'ngx_stream_module'\r\n```\r\n\r\n最后,重新加载 `nginx` 下配置文件\r\n```bash\r\n$ nginx -s reload\r\n\r\n# 查看代理端口是否成功\r\n$ ss -atn | grep 16379\r\n```\r\n","author":{"url":"https://github.com/codcodog","@type":"Person","name":"codcodog"},"datePublished":"2020-11-24T13:08:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/125/Blog/issues/125"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7ec9a5c0-4ab5-53b8-e362-7f24fee78c90
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD3EE:3A75DA:4710F9:5FF3BF:6A4C2F83
html-safe-nonceab7df788bf9b18c8c6a6a590386a313650b5825fbe58b964365d51d04ab14704
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0VFOjNBNzVEQTo0NzEwRjk6NUZGM0JGOjZBNEMyRjgzIiwidmlzaXRvcl9pZCI6Ijc1NjE1MTY4Mjk1MTM2MjU0NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace330a44ef0d9ec2b9318dbacd22b328e74e21e417de54e6f76f821ad8de8197a
hovercard-subject-tagissue:749692519
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/codcodog/Blog/125/issue_layout
twitter:imagehttps://opengraph.githubassets.com/02e913e7a692d0232a229075397626285686e2b16aa9b44a74f4aea19b775e8c/codcodog/Blog/issues/125
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/02e913e7a692d0232a229075397626285686e2b16aa9b44a74f4aea19b775e8c/codcodog/Blog/issues/125
og:image:altnginx 转发 redis 场景 本地开发,需要连接测试环境的 redis,但 redis 是内网的,不对外网开放. 方案 利用 nginx 进行反向代理,把请求转发到内网的 redis 上. 找到测试环境的一台 nginx,配置反向代理. 修改 nginx.conf http { ... } # 注意跟 http 同级 stream { upstream redis { server 1...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecodcodog
hostnamegithub.com
expected-hostnamegithub.com
None1b6b16d04026f131a36d57e3b01d0f4d26a51800edf48bf5ed0256e0ac905511
turbo-cache-controlno-preview
go-importgithub.com/codcodog/Blog git https://github.com/codcodog/Blog.git
octolytics-dimension-user_id18098145
octolytics-dimension-user_logincodcodog
octolytics-dimension-repository_id75478736
octolytics-dimension-repository_nwocodcodog/Blog
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id75478736
octolytics-dimension-repository_network_root_nwocodcodog/Blog
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9ee13484b32cf23e15fde191da4c9aa47d41201c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/codcodog/Blog/issues/125#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcodcodog%2FBlog%2Fissues%2F125
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcodcodog%2FBlog%2Fissues%2F125
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=codcodog%2FBlog
Reloadhttps://github.com/codcodog/Blog/issues/125
Reloadhttps://github.com/codcodog/Blog/issues/125
Reloadhttps://github.com/codcodog/Blog/issues/125
codcodog https://github.com/codcodog
Bloghttps://github.com/codcodog/Blog
Notifications https://github.com/login?return_to=%2Fcodcodog%2FBlog
Fork 1 https://github.com/login?return_to=%2Fcodcodog%2FBlog
Star 20 https://github.com/login?return_to=%2Fcodcodog%2FBlog
Code https://github.com/codcodog/Blog
Issues 135 https://github.com/codcodog/Blog/issues
Pull requests 0 https://github.com/codcodog/Blog/pulls
Actions https://github.com/codcodog/Blog/actions
Wiki https://github.com/codcodog/Blog/wiki
Security and quality 0 https://github.com/codcodog/Blog/security
Insights https://github.com/codcodog/Blog/pulse
Code https://github.com/codcodog/Blog
Issues https://github.com/codcodog/Blog/issues
Pull requests https://github.com/codcodog/Blog/pulls
Actions https://github.com/codcodog/Blog/actions
Wiki https://github.com/codcodog/Blog/wiki
Security and quality https://github.com/codcodog/Blog/security
Insights https://github.com/codcodog/Blog/pulse
nginx 转发 redishttps://github.com/codcodog/Blog/issues/125#top
Nginxhttps://github.com/codcodog/Blog/issues?q=state%3Aopen%20label%3A%22Nginx%22
https://github.com/codcodog
codcodoghttps://github.com/codcodog
on Nov 24, 2020https://github.com/codcodog/Blog/issues/125#issue-749692519
Nginxhttps://github.com/codcodog/Blog/issues?q=state%3Aopen%20label%3A%22Nginx%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.