proxypass

Apache ProxyPass removes Authorization header

為{幸葍}努か 提交于 2019-12-01 06:56:03
问题 I have an Apache server setup as a reverse proxy in front of a some backend servers. One of the backend servers requires basic authentication but somehow Apache seems to remove the Authorization header from the request. Do I have to configure something special in order to make Apache pass on the Authorization header to the backend server? My Apache configuration is pretty basic. I only added some proxy directives like: ProxyRequests Off ProxyPass /backend-server https://backend.server

Modifying a Location header with nginx proxy_pass

懵懂的女人 提交于 2019-12-01 02:37:31
I have an nginx proxy_pass setup to pass every request on /api through to a backend Tomcat REST service. This service in some cases returns a Location header which varies according to the type of request, e.g., Location: http://foo.bar/baz/api/search/1234567 -- the baz part is due to it being hosted on Tomcat. My current configuration rewrites the foo.bar host name correctly, but leaves the baz part intact. I'd like to strip this, but the proxy_pass options seem to be limited to clearing or setting a new value for the header. Is there a way to modify headers dynamically before being passed on

Modifying a Location header with nginx proxy_pass

孤街醉人 提交于 2019-11-30 22:12:28
问题 I have an nginx proxy_pass setup to pass every request on /api through to a backend Tomcat REST service. This service in some cases returns a Location header which varies according to the type of request, e.g., Location: http://foo.bar/baz/api/search/1234567 -- the baz part is due to it being hosted on Tomcat. My current configuration rewrites the foo.bar host name correctly, but leaves the baz part intact. I'd like to strip this, but the proxy_pass options seem to be limited to clearing or

Nginx proxy_pass with $remote_addr

筅森魡賤 提交于 2019-11-30 02:47:58
I'm trying to include $remote_addr or $http_remote_addr on my proxy_pass without success. The rewrite rule works location ^~ /freegeoip/ { rewrite ^ http://freegeoip.net/json/$remote_addr last; } The proxy_pass without the $remote_addr works, but freegeoip does not read the x-Real-IP location ^~ /freegeoip/ { proxy_pass http://freegeoip.net/json/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; } Then, I'm adding the ip to the end of the request, like this: location ^~ /freegeoip/ { proxy_pass http://freegeoip

Apache proxyPassReverse and Websockets

怎甘沉沦 提交于 2019-11-30 00:46:18
问题 I've been working on a Perl Mojolicious project that uses websockets. I'm wanting to launch it on a shared server running apache and use proxyPass and proxyPassReverse to make the url prettier for my Mojolicious code running with Hypnotoad. I have it set up as follows. Apache url: mydomain.com Hypnotoad url: mydomain.com:8080 With the following apache entry I can reverse proxy the Hypnotoad server to project.mydomain.com apache.conf entry <VirtualHost *:80> ServerName project.mydomain.com

Set up an HTTP proxy to insert a header

心不动则不痛 提交于 2019-11-28 16:49:43
I need to test some HTTP interaction with a client I'd rather not modify. What I need to test is the behavior of the server when the client's requests include a certain, static header. I'm thinking the easiest way to run this test is to set up an HTTP proxy that inserts the header on every request. What would be the simplest way to set this up? Peter Hilton I do something like this in my development environment by configuring Apache on port 80 as a proxy for my application server on port 8080, with the following Apache config: NameVirtualHost * <VirtualHost *> <Proxy http://127.0.0.1:8080/*>

How to add a response header on nginx when using proxy_pass?

≡放荡痞女 提交于 2019-11-28 15:51:36
I want to add a custom header for the response received from the server behind nginx. While add_header works for nginx-processed responses, it does nothing when the proxy_pass is used. There is a module called HttpHeadersMoreModule that gives you more control over headers. It does not come with Nginx and requires additional installation. With it, you can do something like this: location ... { more_set_headers "Server: my_server"; } That will "set the Server output header to the custom value for any status code and any content type". It will replace headers that are already set or add them if

Configure Nginx with proxy_pass

不羁岁月 提交于 2019-11-28 05:07:24
I'm trying to configure Nginx to proxy stuff on a subdomain: dev.int.com I want dev.int.com to be proxied to IP:8080, and dev.int.com/stash to be proxied to IP:7990 Here's my current config file server { listen 80; server_name dev.int.com; access_log off; location / { proxy_pass http://IP:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $remote_addr; port_in_redirect off; proxy_redirect http://IP:8080/jira /; proxy_connect_timeout 300; location ~ ^/stash { proxy_pass http://IP:7990; proxy_set_header Host $host; proxy_set_header X-Real

https redirect for rails app behind proxy?

元气小坏坏 提交于 2019-11-27 14:38:15
问题 server declaration in my nginx.conf: listen 1.2.3.4:443 ssl; root /var/www/myapp/current/public; ssl on; ssl_certificate /etc/nginx-cert/server.crt; ssl_certificate_key /etc/nginx-cert/server.key; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://upstreamy; break; } } upstream declaration in nginx.conf: upstream upstreamy { server unix:/var/www//myapp/shared/sockets

apache ProxyPass: how to preserve original IP address

自闭症网瘾萝莉.ら 提交于 2019-11-27 11:33:56
We are using ProxyPass to redirect all "/r" requests to jboss on port 18080 as follows: ProxyPreserveHost on ProxyPass /r http://localhost:18080/redirectService/ ProxyPassReverse /r http://localhost:18080/redirectService/ But, that causes the IP address logged in jboss's access log as "127.0.0.1". Does somebody know how can we preserve the original IP from where the request came in HttpServletRequest? We want to acesss it from jboss servlet request in doGet() You can get the original host from X-Forwarded-For header field. The answer of JasonW is fine. But since apache httpd 2.4.6 there is a