当前位置:网站首页>花生壳内网穿透映射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无法替换压缩的网页内容
边栏推荐
- RIA想法
- The State Council issued a document to improve the application of identity authentication and electronic seals, and strengthen the construction of Digital Government
- 小小面试题之GET和POST的区别
- 机器学习 05:非线性支持向量机
- There are applications related to web network request API in MATLAB (under update)
- Project suspension
- Leetcode114. 二叉树展开为链表
- Redis usage and memory optimization
- 怎么把平板作为电脑的第二扩展屏幕
- Some doubts about ARP deception experiment
猜你喜欢
随机推荐
转帖——不要迷失在技术的海洋中
从新东方直播来探究下小程序音视频通话及互动直播
使用Jedis監聽Redis Stream 實現消息隊列功能
[arm] build boa based embedded web server on nuc977
力扣 875. 爱吃香蕉的珂珂
cross entropy loss = log softmax + nll loss
电商借助小程序技术发力寻找增长突破口
Data storage: the difference between MySQL InnoDB and MyISAM
421-二叉树(226. 翻转二叉树、101. 对称二叉树、104.二叉树的最大深度、222.完全二叉树的节点个数)
Day3 - variables and operators
工厂方法模式、抽象工厂模式
C XX management system
MySQL数据库-01数据库概述
定位设置水平,垂直居中(多种方法)
电机专用MCU芯片LCM32F037系列内容介绍
cross entropy loss = log softmax + nll loss
自定义WebSerivce作为代理解决SilverLight跨域调用WebService问题
kolla-ansible部署openstack yoga版本
bingc(继承)
Customize WebService as a proxy to solve the problem of Silverlight calling WebService across domains








