Cookie rejected: Illegal path attribute "/nexus". Path of origin: "/content/" 解
问题叙述性说明
通过运行“mvn clean deploy” 命令 将 Maven 项目公布 Nexus 当PW。举例控制台输出以下警告消息:
[INFO] Downloaded: dav:http://maven.mysite.com/content/repositories/snapshots/${groupId}/${artifactId}/${version}/maven-metadata.xml (2 KB at 10.5 KB/sec)
[INFO] Uploading: http://maven.mysite.com/content/repositories/snapshots/${groupId}/${artifactId}/${version}/${artifactId}-xxx.jar
2015-3-19 10:20:47 org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
警告: Cookie rejected: "$Version=0; rememberMe=deleteMe; $Path=/nexus". Illegal path attribute "/nexus". Path of origin: "/content/"
2015-3-19 10:20:47 org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
警告: Cookie rejected: "$Version=0; rememberMe=deleteMe; $Path=/nexus". Illegal path attribute "/nexus". Path of origin: "/content/repositories/"
2015-3-19 10:20:47 org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
警告: Cookie rejected: "$Version=0; rememberMe=deleteMe; $Path=/nexus". Illegal path attribute "/nexus". Path of origin: "/content/repositories/snapshots/"
2015-3-19 10:20:47 org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
警告: Cookie rejected: "$Version=0; rememberMe=deleteMe; $Path=/nexus". Illegal path attribute "/nexus". Path of origin: "/content/repositories/snapshots/${groupId}/"
2015-3-19 10:20:47 org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
警告: Cookie rejected: "$Version=0; rememberMe=deleteMe; $Path=/nexus". Illegal path attribute "/nexus". Path of origin: "/content/repositories/snapshots/${groupId}/${artifactId}/"
2015-3-19 10:20:47 org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
警告: Cookie rejected: "$Version=0; rememberMe=deleteMe; $Path=/nexus". Illegal path attribute "/nexus". Path of origin: "/content/repositories/snapshots/${groupId}/${artifactId}/${version}/"
2015-3-19 10:20:47 org.apache.commons.httpclient.HttpMethodBase processResponseHeaders
警告: Cookie rejected: "$Version=0; rememberMe=deleteMe; $Path=/nexus". Illegal path attribute "/nexus". Path of origin: "/content/repositories/snapshots/${groupId}/${artifactId}/${version}/${artifactId}-xxx.jar"
…… ……
[INFO] Uploaded: http://maven.mysite.com/content/repositories/snapshots/${groupId}/${artifactId}/${version}/${artifactId}-3.0.4-20150319.022040-25.jar (60 KB at 76.6 KB/sec)
系统环境
私服是搭建在一台 Windows Server 2008 的阿里云server上,Nexus 的版本号为 2.8.1,通过 Ngnix 1.7.10 进行反向代理(http://maven.mysite.com/ 直接指向 http://127.0.0.1:8081/nexus)。
开发机是 Windows 7,使用 Maven 版本号为 3.0.4。
问题分析
依据控制台输出的警告信息可知,这是 cookie 的 path 属性不一致,须要 path=/nexus 下的 cookie,而如今相应的路径 /content/repositories/snapshots/${groupId}/${artifactId}/${version}/ 中并不包括 /nexus 这一级。
依据这个推断,于是我将 snapshots 的 URL 由 http://maven.gboat.xyz/content/repositories/snapshots
改为 http://maven.gboat.xyz:8081/nexus/content/repositories/snapshots,然后又一次运行 mvn clean deploy 公布 jar 包到私服,这一次的公布过程中果然没有出现不论什么警告信息。
由于改动之后的这个 URL 是没有通过 Nginx 作代理进行转发的,所以。如今已经能够确定问题是出在 Nginx 的代理配置这一块了。
解决方式
问题产生的原因已经找到了。接下来就是依据问题原因寻找相应的解决方式了。
经过查阅资料得知。仅仅须要在 Nginx 的代理配置中添加 cookie 的 path 映射关系就可以。官方文档请參见:ngx_http_proxy_module
模块中的 proxy_cookie_path,改动后的配置例如以下:
# Maven
server {
listen 80;
server_name maven.mysite.com; location / {
proxy_pass http://127.0.0.1:18081/nexus/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_cookie_path /nexus /;
…… ……
}
location ~ ^/nexus/(.*)$ {
return 301 /$1;
}
}
另外,假设您是使用的 Apathe 做反向代理。那应该通过 ProxyPassReverseCookiePath 进行配置,如:
ProxyPassReverseCookiePath /nexus /
參考资料:http://books.sonatype.com/nexus-book/reference/install-sect-proxy.html
版权声明:本文博主原创文章。博客,未经同意不得转载。
Cookie rejected: Illegal path attribute "/nexus". Path of origin: "/content/" 解的更多相关文章
- httpclient提示Cookie rejected: violates RFC 2109: domain must start with a dot
使用httpclient时发生如下告警信息: WARN - HttpMethodBase.processResponseHeaders(1505) | Cookie rejected: "$ ...
- HttpClient3.1 警告: Cookie rejected:
四月 , :: 下午 org.apache.commons.httpclient.HttpMethodBase processCookieHeaders 警告: Cookie rejected: : ...
- The Path Attribute
https://tools.ietf.org/html/rfc6265#section-5.1.1 4.1.2.4. The Path Attribute The scope of each cook ...
- python:PATH、PYTHONPATH 和 sys.path 的区别
python:PATH.PYTHONPATH 和 sys.path 的区别 共同点 所有在它们的路径里面的 moduel 都可以被 import PATH 在 PATH 中的一些命令,例如 *.exe ...
- 安装vmware-tools遇the path "" is not valid path to the gcc binary和the path "" is not a valid path to the 3.10.0-327.e17.x86_64 kernel headers问题解决
#./vmware-install.pl踩点: 1.the path "" is not valid path to the gcc binary 2.the path " ...
- The path is not a valid path to the xxx kernel header
在安装vmtools时无意中出现了这样的问题 1.gcc错误 Searching for GCC- The path "" is not valid path to the gcc ...
- vmware + centos 7安装vmtools时提示The path "" is not a valid path to the xxx kernel header
在安装vmtools时无意中出现了这样的问题 1.gcc错误 Searching for GCC- The path "" is not valid path to the gcc ...
- python3 os.path.realpath(__file__) 和 os.path.cwd() 方法的区别
python3 os.path.realpath(__file__) 和 os.path.cwd() 方法的区别 os.path.realpath 获取当前执行脚本的绝对路径. os.path.rea ...
- VMware安装VMware tool是 遇到The path "" is not a valid path to the 3.10.0-693.el7.x86_64 kernel headers.
The path "" is not a valid path to the 3.10.0-693.el7.x86_64 kernel headers.问题是找不到内核头文件,需要 ...
随机推荐
- hdu 1086(判断线段相交)
传送门:You can Solve a Geometry Problem too 题意:给n条线段,判断相交的点数. 分析:判断线段相交模板题,快速排斥实验原理就是每条线段代表的向量和该线段的一个端点 ...
- hdu1054(最小顶点覆盖)
传送门:Strategic Game 题意:用尽量少的顶点来覆盖所有的边. 分析:最小顶点覆盖裸题,最小顶点覆盖=最大匹配数(双向图)/2. #include <cstdio> #incl ...
- RCP开发中错误:java.lang.RuntimeException: WARNING: Prevented recursive attempt to activate part...
在做RCP的eclipse插件开发时,启动管理软件界面时,总是报如下错误 : !ENTRY org.eclipse.ui.workbench 4 0 2012-05-25 18:44:21.306 ! ...
- Python的控制结构(转)
首先我的工作第一语言是c/c++(面向对象子集).选择学习python一方面是因为看很多人都说python开发效率高,所以想验证一下:另一方面,Eric S. Raymond在文章:如何成为一名黑客 ...
- poj2486(树形dp)
题目链接:http://poj.org/problem?id=2486 题意:一颗树,n个点(1-n),n-1条边,每个点上有一个权值,求从1出发,走m步,最多能遍历到的权值. 分析:非常不错的树形d ...
- thinkphp中field的用法
ThinkPHP的连贯操作方法中field方法有很多的使用技巧,field方法主要目的是标识要返回或者操作的字段,下面详细道来. 1.用于查询 在查询操作中field方法是使用最频繁的. $Model ...
- SWT的TreeViewer和TableViewer的交互
左边是一个TreeViewer,右边是一个TableViewer.当点击左边的treeitem的时候,右边的tableViewer要将该item的子节点信息显示出来.就像这样: 左边的treeView ...
- 公司需求知识自学-Oracle的Package的作用及用法
Oracle的Package的作用 简化应用设计.提高应用性能.实现信息隐藏.子程序重载. 1.Oracle的Package除 了把存储过程放到一堆儿以外还有没有其他的作用(好处)? 你不觉得把存储过 ...
- 遇过的坑(2)—MyISAM表类型不支持事务操作
最近需要通过JDBC对数据库做事务型操作,实践时发现,并没有达到想要的效果,表现在:1.每次执行executeUpdate()后,数据就马上能在DB中查到.但按理来说,我还没执行commit(),DB ...
- 在阿里云上布置git server
前言 东莞,晴,26至32度. 一直以为都是使用SVN Server作为私用的版本号控制器.随着Git的大行其道.近期由于项目须要,也试着在阿里云上部署Git Server.这里由于团队人员少.我採用 ...