这有点奇怪....我们有一个在服务器(A)上运行的内部Web应用程序和在服务器(B)上运行的文档存储库.
我在页面上有简单的链接,我想让用户下载文档(从IIS服务器(A)).但是,在用户单击按钮之前,此文档在服务器(A)上不存在(因为有40多个要显示的文档无法在页面加载时加载它们)
当用户单击链接时(此时我希望提示下载)文档被复制到服务器(A),然后重定向到浏览器提示他们下载的页面.我相信我已经正确设置了内容标题,它可以在FireFox中使用.
IE(7)只是弹出一个窗口,然后窗口消失,如果我关闭安全设置它工作正常,但这不是一个选项.
任何想法如何解决这个问题.我不能直接指向服务器上的文件(B)
附加:是服务器B也是Web服务器
我正在WildFly 8.1.0上运行一个Web应用程序,显然我的应用程序工作正常.但是,查看日志文件时我发现了一个奇怪的异常.我以前从未见过这个例外.
我使用Apache 2.4作为反向代理.此反向代理使用AJP端口完成.
javax.servlet.ServletException:Cookie名称"ctx:1420m06d05"是保留令牌
2014-07-07 11:10:57,512 ERROR [io.undertow.request] (default task-23) UT005023: Exception handling request to /app/emp/index.jspa: javax.servlet.ServletException: Cookie name "ctx:1420m06d05" is a reserved token
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final] …Run Code Online (Sandbox Code Playgroud) 我正在尝试一种检测代理连接的工具,其中一个 IP 地址被检测为 DCH 代理,但这意味着什么?
我有一个 Plex 服务器运行在website.com:32400/web. 我希望能够plex.website.com使用 Apache 的反向代理功能访问它。以下是我的/etc/apache2/sites-available/plex.website.com.conf文件(的相关部分):
<VirtualHost *:80>
ServerName plex.website.com
ProxyRequests off
ProxyPass / http://website.com:32400/web/
ProxyPassReverse / http://website.com:32400/web/
ProxyHTMLURLMap http://website.com:32400/web http://plex.website.com
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
此设置部分有效;也就是说,如果我去,plex.website.com/index.html那么我得到的 HTML 与我去website.com:32400/web/index.html. 然而,除此之外,其他一切似乎都是 404(即 CSS 和 JavaScript)。例如,http://website.com:32400/web/img/desktop/ios/icon-iphone.png加载正常,但http://plex.website.com/web/img/desktop/ios/icon-iphone.png会产生 404 错误。
不过,似乎我可以直接访问web目录中的任何内容,例如plex.website.com/favicon.ico可以正常加载的内容。很明显,这是映射子域的问题。
所有必需的 Apache 模块都已启用。
我不太确定我会如何开始尝试解决这个问题。
编辑:我刚刚意识到它是 404'ing 的原因是它仍然包含web不应该包含的 URL 部分。在我给出的例子中,http://plex.website.com/web/img/desktop/ios/icon-iphone.png是它试图访问的位置 - 但这应该是http://plex.website.com/img/desktop/ios/icon-iphone.png。所以我怀疑是ProxyHTMLURLMap.
在这种情况下,Apache Http Server 将充当反向代理并位于主应用程序服务器的前面。在应用程序服务器中,需要记录客户端 IP 地址。
我的要求是捕获客户端IP地址,然后将此IP地址添加为自定义请求头(例如TRUEIP=123.123.123.123)并将其转发到应用程序服务器。请注意,我已阅读有关将原始客户端 IP 记录到 apache 日志的文章。但是我要求访问 IP 地址并将其添加到标头中。此外,我确实尝试使用“%{h}i”或“%{h}e”访问环境变量,但在这种情况下,标题值显示为“i=18”(不带引号)。实际上,对于 User-Agent,Referer 的标题值也打印了相同的“i=18”。
请帮我解决一个问题。
我在 Windows 7 上使用 Apache 2.4.28(来自 apache 休息室)。 Oracle OC4J 中使用的应用程序服务器(但我只需要在 Apache 端进行配置,因为应用程序在不同的环境中可能会有所不同)。
我有一个在网站上运行的 Nginx 服务器https://example.com。我正在尝试通过反向代理在我拥有/管理员的另一台远程服务器上提供一个页面(来自 OctoPi),在http://1.2.3.4:1988.
我可以在 上提供主页https://example.com/foo/,但是 css 和 js 文件没有加载。控制台显示诸如此类的文件https://example.com/foo/static/webassets/packed_libs.css给出了 404 错误。如果我访问,https://1.2.3.4:1988/foo/static/webassets/packed_libs.css我可以读取 css 文件。
我确定我的 nginx 配置文件/etc/nginx/sites-available/default可能是 fubar-ed,但我似乎无法弄清楚在哪里,因为错误或访问日志暴露了任何错误,OctoPi 上的 haproxy 日志也没有。
Nginx 配置文件:
server {
listen 80;
server_name www.example.com;
listen [::]:80 default_server;
return 301 https://example.com$request_uri;
}
server {
listen 443 ssl;
server_name www.example.com;
return 301 https://example.com$request_uri;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
# managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # …Run Code Online (Sandbox Code Playgroud) 我正在使用Cloudflare管理域的DNS。
Netlify托管了的营销页面。
主应用程序由Heroku托管。
cloudflare +裸域(my-example.com)是否有可能由Netlify提供服务的某些路径以及由Heroku提供的其他路径?
还是我被迫将托管服务之一放在子域上?
我有以下配置:
server {
listen 80;
server_name localhost;
location /app {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /app/index.html?$args;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Run Code Online (Sandbox Code Playgroud)
当http://localhost:8000/app/按预期导航到所有工作但删除尾部斜杠 ( http://localhost:8000/app) 时,nginx 返回 301 状态响应,我被重定向到http://localhost/app.
我怎样才能让 nginx 同时使用http://localhost:8000/app/和http://localhost:8000/app(带和不带斜杠)。
我正在尝试使用 Docker Compose 容器化与我的 Web 应用程序相关的所有内容,包括 Nginx 和 SSL 证书。为此,我使用了来自 JWilder和LetsEncrypt Companion的Nginx 代理映像,但无法让 nginx 代理正常工作,结果最终是:
Nginx 502 错误网关
[错误] 31160#0:*35 connect() 失败(111:连接被拒绝),同时连接到上游,客户端:xx.xx.xx.xx,服务器:domain.com,请求:“GET /dev/HTTP/1.1 ", 上游: "webapp://127.0.0.1:8080", 主机: "domain.com"
这仅在尝试设置 Nginx 代理和 SSL 证书时发生,所以我知道这是这些容器中的一个或两个的配置问题。如果有人能发现我哪里出错了,我将不胜感激!
以下是有问题的容器:
version: '3.1'
networks:
mywebapp:
services:
nginx-proxy:
container_name: nginx-proxy
build: ./env/nginx-proxy
networks:
- mywebapp
ports:
- 80:80
- 443:443
env_file:
- ./env/nginx-proxy/.env
depends_on:
- webapp
tty: true
volumes:
- ./src:/home/www/mywebapp/src
- ./storage:/home/www/storage/mywebapp
- ./data/nginx-proxy/logs:/var/log/nginx
- ./env/nginx-proxy/webserver/nginx.conf:/etc/nginx/nginx.conf
- ./env/nginx-proxy/webserver/conf.d:/etc/nginx/conf.d
- ./env/nginx-proxy/webserver/vhost.d:/etc/nginx/vhost.d
- …Run Code Online (Sandbox Code Playgroud) reverse-proxy nginx docker docker-compose jwilder-nginx-proxy
所以我有一个 Next.js React 组件,它使用 getInitialProps 在初始页面加载之前调用一些数据的后端。这是它的样子:
static async getInitialProps({req, query}){
console.log('inside getInitialProps')
if (req){
var pinReturn = await axios.post(process.env.serverADD+'getPinData', {withCredentials: true})
.then(response=>{
console.log('value of response: ', response)
return response.data.pins
})
.catch(error=>{
console.log('value of error: ', error)
return({})
})
}
return {pinData: pinReturn}
}
Run Code Online (Sandbox Code Playgroud)
我认为这是不言自明的 - 当我的后端是一个简单的 docker 容器时它可以工作。但是,现在我使用 nginx 和 docker-compose 来启动我的前端和后端。目前我process.env.serverADD的等于http://localhost:80/back/.
我的 NGINX 是:
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com localhost;
location /back {
proxy_set_header X-Real-IP …Run Code Online (Sandbox Code Playgroud)