Hot answers tagged

114 votes
Accepted

SSH from A through B to C, using private key on B

Schematic: ssh ssh A ------> B ------> C ^ ^ using A's using B's ssh key ssh key Preconditions: A is running ssh-agent; A can access B; B can access C; A's ssh ...
  • 1,493
70 votes

Nginx location regex doesn't work with proxy pass

A small addition to the great answer from Xaviar: If you happen to be not so well acquainted with nginx, there's an important difference between adding the slash to the end of the proxy_pass ...
59 votes
Accepted

How to reverse proxy to different places depending on subdomain in Nginx?

Unless I completely misread your question: You simply set up server blocks for each sub-domain and the define the correct reverse proxy for the root of that subdomain i.e. something along the lines ...
  • 74k
43 votes
Accepted

Why am I getting an "Invalid command 'ProxyPass'" error when I start my Apache 2.2 server?

proxy_http module requires proxy, and ProxyPass directive is defined in the latter. Make sure it's also loaded. Thanks to Milind Singh Load the module by running Run sudo a2enmod proxy_http
40 votes
Accepted

windows 10 ssh proxycommand: "posix_spawn: No such file or directory"

As per this bug, the fix is to use a full path. So this is the correct line in the .ssh/config: ProxyCommand C:\Windows\System32\OpenSSH\ssh.exe jumphost netcat -w 120 %h %p For further ...
  • 911
35 votes
Accepted

Is there a cloud-based reverse proxy solution in AWS?

You can use AWS API Gateway (documentation). API Gateway helps developers deliver robust, secure and scalable mobile and web application backends. API Gateway allows developers to securely connect ...
33 votes

windows 10 ssh proxycommand: "posix_spawn: No such file or directory"

TL;DR The ProxyCommand should invoke ssh with .exe extension, for example: ProxyCommand ssh.exe -q -W %h:%p yyy The long(?) story Running ssh -vvv XXX shows: debug3: spawning "C:\\Windows\\...
  • 431
30 votes

Nginx proxy by Request Method

Although you could achieve this with if, this is generally discouraged by the Nginx documentation, because if doesn't play well with other directives. For example, assume that GET should be open for ...
  • 558
22 votes
Accepted

Relationship between bastion host and jump host

A Bastion host is a machine that is outside of your security zone. And is expected to be a weak point, and in need of additional security considerations. Because your security devices are technically ...
  • 5,587
20 votes
Accepted

How can I make docker-compose pull images using a socks5 proxy?

Looks like this feature has been recently added to docker, particularly in version 1.11.0. Though there isn't enough documentation about its usage, setting the ALL_PROXY environment variable should ...
20 votes
Accepted

proxy_set_header not working

You've got it wrong. proxy_set_header directive sets headers that nginx sends to backend (127.0.0.1:8069 in your case). What you need is add_header directive.
  • 8,180
20 votes
Accepted

Simple reverse proxy with Traefik

You are missing the backend type definition (file, Docker, Swarm...). In your case just add (or uncomment) [file] in your conf file, like that: defaultEntryPoints = ["http"] [entryPoints] [...
17 votes

Nginx not caching data

From: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid Syntax: proxy_cache_valid [code ...] time; ... Parameters of caching can also be set directly in the ...
  • 311
16 votes
Accepted

Is it possible to replace content on every page passed through a proxy similar to how mod_rewrite is used for URLs?

There's an apache module called mod_substitute that can do this. Here's a short example: <Location "/"> AddOutputFilterByType SUBSTITUTE text/html Substitute "s/uat.site.co.jp/jp.uat....
  • 27.6k
15 votes

Difference beetween DNAT and REDIRECT in IPTABLES

REDIRECT does alter the destination IP address to send to the machine itself as answered by Warner@. But I'd say that answer is not totally correct, or a bit misleading. REDIRECT is not just for ...
15 votes
Accepted

Tinyproxy Refused CONNECT method

Your log states that the CONNECT method was denied for port 80, which is not in your config as an allowed ConnectPort. The CONNECT method is used to establish a tunneled HTTP connection; HTTPS. ...
  • 2,235
15 votes
Accepted

Configure HAProxy to include host headers for different backends

I'm not sure if the following will work, and can't test right now, but maybe this is still helpful. (I'll have a look again later with some more time): Solution 1: backend nodes mode http ...
  • 5,541
15 votes
Accepted

How do I make protocol foo hostname-aware?

To understand what's going on, you need to know a little about DNS. When a client wants to connect to a service on a given host, it looks up the hostname through its local DNS infrastructure, and ...
  • 79.2k
14 votes

Why does sub_filter seem to not work when used in conjunction with proxy_pass?

James T Snell answered it in a comment: I didn't have proxy_set_header Accept-Encoding ""; you need that to tell the backend that compression isn't allowed in a response.
  • 271
14 votes

Single server, nginx as a reverse proxy, multiple domains/websites

Normally you create a new config file /etc/nginx/sites-available/newserver.conf for the new server and link it from /etc/nginx/sites-enabled. To use nginx as reverse proxy, you configure SSL in nginx (...
  • 184
13 votes

Forward NTLM authentication to corporate proxy from local proxy server

Might be a bit late but wanted to mention this nonetheless. No doubt having NTLM support in your script would be great but that would add complexity for no big returns. Might be best to use NTLMAps, ...
13 votes
Accepted

How to enable SOCKS5 for Squid proxy?

Have a look at this page. It talks about squid socks support and how you can build it to support SOCKS connections. The status is "testing". So, you may need to think about using it for production. ...
  • 36.2k
12 votes
Accepted

How to automatically configure username/password with proxy PAC file?

I had similar problem, so create a tool: https://github.com/sjitech/proxy-login-automator This tool can create a local proxy and automatically inject user/password to real proxy server. Support PAC ...
  • 355
12 votes
Accepted

PostgreSQL Stack Builder Installation Proxy Setting on Windows

My LAN server doesn't have internet access, I also find that StackBuilder from EDB doesn't respect proxy setting on Windows (am upgrading to 9.6.2), be it IE proxy setting or the proxy setting box in ...
  • 268
12 votes

Is it possible to configure proxy setting through dhcp?

You can configure your DHCP server for Web Proxy Autodiscovery Protocol: Create a PAC file and host it on a local web server. Then have your DHCP server provide the URL of the PAC file (e.g. http://...
12 votes
Accepted

SSH config ProxyCommand asks for public key

ProxyCommand doesn't work the way you think it does. The command specified is not run on the gateway machine. Rather, it is run on the connecting machine. The flow of execution is therefore: The ...
11 votes

What IP does nginx use for ip_hash sticky sessions?

While this question is quite old and the answer is correct, after some digging to resolve my own load balancing problem I found that there is a newer option to make the client ip based on the X-...
  • 111
11 votes

NGINX Proxy Pass to NodeJS App: Returning 502 error

It could also be SELinux that's preventing the connection being made as httpd_can_network_connect is off by default. getsebool httpd_can_network_connect Check if this is turned on. If not, turn it ...
11 votes
Accepted

Retrieve internet proxy server address via PowerShell

Here is the PowerShell function to achieve my goal : function Get-InternetProxy { <# .SYNOPSIS Determine the internet proxy address .DESCRIPTION ...
  • 180
11 votes
Accepted

encode URL wihthin URL - apache mod-proxy (ProxyPass)

In the default Apache configuration, the AllowEncodedSlashes directive is set to off. This means that: "...The AllowEncodedSlashes directive allows URLs which contain encoded path separators [...] to ...

Only top scored, non community-wiki answers of a minimum length are eligible