proxypass

Set up an HTTP proxy to insert a header

依然范特西╮ 提交于 2019-11-27 09:57:46
问题 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? 回答1: 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

Configure Nginx with proxy_pass

不问归期 提交于 2019-11-27 05:26: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

Setup nginx not to crash if host in upstream is not found

拟墨画扇 提交于 2019-11-27 00:16:16
We have several rails apps under common domain in Docker, and we use nginx to direct requests to specific apps. our_dev_server.com/foo # proxies to foo app our_dev_server.com/bar # proxies to bar Config looks like this: upstream foo { server foo:3000; } upstream bar { server bar:3000; } # and about 10 more... server { listen *:80 default_server; server_name our_dev_server.com; location /foo { # this is specific to asset management in rails dev rewrite ^/foo/assets(/.*)$ /assets/$1 break; rewrite ^/foo(/.*)$ /foo/$1 break; proxy_pass http://foo; } location /bar { rewrite ^/bar/assets(/.*)$

Nginx reverse proxy causing 504 Gateway Timeout

孤街浪徒 提交于 2019-11-26 21:34:11
I am using Nginx as a reverse proxy that takes requests then does a proxy_pass to get the actual web application from the upstream server running on port 8001. If I go to mywebsite.com or do a wget, I get a 504 Gateway Timeout after 60 seconds... However, if I load mywebsite.com:8001, the application loads as expected! So something is preventing Nginx from communicating with the upstream server. All this started after my hosting company reset the machine my stuff was running on, prior to that no issues whatsoever. Here's my vhosts server block: server { listen 80; server_name mywebsite.com;

Apache2 ProxyPass for Rails App Gitlab

吃可爱长大的小学妹 提交于 2019-11-26 16:35:22
I am attempting to setup a proxy with Apache2 so that incoming requests to http://myipaddress.com go to http://localhost:3000/ where I have Gitlab ( a rails app ) running. The following is what I have in my Apache configuration file on Ubuntu 10.04. I can successfully access the gitlab default page initially, but any subsequent requests performed by me by clicking on other pages after that go to a 404 NOT FOUND page. I can manually enter /gitlab/ in front of any of these failed redirects and they work just fine. How can I make this work without having to rewrite /gitlab/ after each redirect

apache ProxyPass: how to preserve original IP address

痴心易碎 提交于 2019-11-26 15:34:53
问题 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() 回答1: You can get the original

Setup nginx not to crash if host in upstream is not found

别等时光非礼了梦想. 提交于 2019-11-26 09:18:06
问题 We have several rails apps under common domain in Docker, and we use nginx to direct requests to specific apps. our_dev_server.com/foo # proxies to foo app our_dev_server.com/bar # proxies to bar Config looks like this: upstream foo { server foo:3000; } upstream bar { server bar:3000; } # and about 10 more... server { listen *:80 default_server; server_name our_dev_server.com; location /foo { # this is specific to asset management in rails dev rewrite ^/foo/assets(/.*)$ /assets/$1 break;

Nginx reverse proxy causing 504 Gateway Timeout

喜你入骨 提交于 2019-11-26 08:48:17
问题 I am using Nginx as a reverse proxy that takes requests then does a proxy_pass to get the actual web application from the upstream server running on port 8001. If I go to mywebsite.com or do a wget, I get a 504 Gateway Timeout after 60 seconds... However, if I load mywebsite.com:8001, the application loads as expected! So something is preventing Nginx from communicating with the upstream server. All this started after my hosting company reset the machine my stuff was running on, prior to that