当前位置:网站首页>花生壳内网穿透映射NPM私服问题
花生壳内网穿透映射NPM私服问题
2022-06-26 05:46:00 【omage】
笔者之前曾经写过一篇博文介绍如何搭建NPM私服
如何快速用docker搭建npm私服_omage的博客-CSDN博客世上功夫,唯快不破!npm包默认下载的官方服务器是 npmjs:https://registry.npmjs.org/由于在国外以及众所周知的原因,npm install直接下会慢到怀疑人生。。。幸好阿里提供了国内淘宝镜像源 taobao:https://registry.npm.taobao.org/ (马首富还是有不少贡献的)我们只需要在本地敲命令切换下npm包源设置npm源npm config set registry https://registry.npm...https://blog.csdn.net/omage/article/details/117289205?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165465298516782390549972%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165465298516782390549972&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-117289205-null-null.nonecase&utm_term=verdaccio&spm=1018.2226.3001.4450这个在公司内网访问没问题,后因同事工作需要,需解决从外网访问NPM私服,就使用花生壳内网穿透来映射,简单的配置了一下后,发现存在问题,即verdaccio在映射到外网时,有部分网页内容还是引用的内网IP地址。
当时找了下verdaccio官网的解决办法,采用了nginx的反向代理,按照它的配置试验没弄成功
Reverse Proxy Setup | VerdaccioUsing a reverse proxy is a common practice. The following configurations are thehttps://verdaccio.org/docs/reverse-proxy/后来自己琢磨了下,修改了配置,可以跑通,现把配置分享下。
server {
listen 14873;
location / {
proxy_set_header Accept-Encoding '';
proxy_pass http://192.1.1.10:4873/;
sub_filter 'http://192.1.1.10:4873' '$scheme://$http_host';
sub_filter_once off;
sub_filter_types *;
}
}
注意:proxy_set_header Accept-Encoding ''; 这个是为了不让verdaccio开启gzip,sub_filter无法替换压缩的网页内容
边栏推荐
- Project suspension
- REUSE_ALV_GRID_DISPLAY 事件实现(DATA_CHANGED)
- Operator priority, associativity, and whether to control the evaluation order [detailed explanation]
- redis探索之布隆过滤器
- SQL query time period content
- Pre-Sale Analysis
- The model defined (modified) in pytoch loads some required pre training model parameters and freezes them
- 小程序如何关联微信小程序二维码,实现二码聚合
- Introduction to alluxio
- 自定义WebSerivce作为代理解决SilverLight跨域调用WebService问题
猜你喜欢
[activity recommendation] cloud native, industrial Internet, low code, Web3, metauniverse... Which is the architecture hot spot in 2022
uniCloud云开发获取小程序用户openid
小程序如何关联微信小程序二维码,实现二码聚合
Overloading and overriding
【ARM】讯为rk3568开发板buildroot添加桌面应用
小程序第三方微信授权登录的实现
转帖——不要迷失在技术的海洋中
5分钟包你学会正则表达式
LeetCode_ Binary search tree_ Simple_ 108. convert an ordered array to a binary search tree
Using Jenkins to perform testng+selenium+jsup automated tests and generate extendreport test reports
随机推荐
DOM文档
Life is so fragile
Use jedis to monitor redis stream to realize message queue function
组合模式、透明方式和安全方式
Pytorch (network model)
Describe an experiment of Kali ARP in LAN
Operator priority, associativity, and whether to control the evaluation order [detailed explanation]
FindControl的源代码
Recursively traverse directory structure and tree presentation
Ribbon load balancing service call
虚拟项目失败感想
使用Jedis監聽Redis Stream 實現消息隊列功能
BOM文档
Posting - don't get lost in the ocean of Technology
Sql语法中循环的使用
[C language] deep analysis of data storage in memory
Uni app ceiling fixed style
机器学习 07:PCA 及其 sklearn 源码解读
从新东方直播来探究下小程序音视频通话及互动直播
Unicloud cloud development obtains applet user openid