Tag Info

Hot answers tagged

18

Use Rewrite conditions to match for this special case: RewriteEngine On RewriteCond %{REQUEST_URI} ^/socket.io [NC] RewriteCond %{QUERY_STRING} transport=websocket [NC] RewriteRule /(.*) ws://localhost:8082/$1 [P,L] ProxyPass /socket.io http://localhost:8082/socket.io ProxyPassReverse /socket.io ...


5

Came across the same issue with Server version: Apache/2.4.6 As per the documentation at [1], "In 2.4.5 and later, SSLProxyCheckPeerCN has been superseded by SSLProxyCheckPeerName, and its setting is only taken into account when SSLProxyCheckPeerName off is specified at the same time." So adding following entry did the trick: SSLProxyCheckPeerName off So ...


5

This IS possible with Haproxy. You can setup a TCP proxy and extract the SNI and do routing based on the SNI. Here's an example: backend be.app1 mode tcp no option checkcache no option httpclose tcp-request inspect-delay 5s tcp-request content accept if { req.ssl_hello_type 1 } tcp-request content reject use-server server1 if { ...


4

You don't need rewrite for this. server { ... location ^~ /api/ { proxy_pass http://localhost:7379/; } location ^~ /api/mypath/ { proxy_pass http://localhost:3936/v1/; } }


4

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.site2uk.co.uk/ni" </Location> Or, when combined with mod_proxy: ProxyPass / http://uat.site.co.jp/ ProxyPassReverse / http://uat.site.co.jp/ Substitute ...


4

This is impossible. SSH has no notion of a Host header as is present in HTTP. The best you can do is port-based routing.


3

Doing any kind of proxying based on the DNS hostname used also requires that the application protocol carries the host header in some way. To my knowledge there are no such headers involved in FTP, so I don't see how this will be possible. Maybe with a custom FTP proxy, that sends you to different servers based on the username or something like that. TLDR: ...


3

If you haven't restarted Apache, be sure to do that, but if you've already done so, you could try a global output filter that runs a custom PHP script to do your replacing just to see if that solves it for some reason. EDIT: based on your comment, it could be that substitute isn't working because the content is compressed. To turn off compression, add ...


3

"Server not found" from a browser often indicates a failure to resolve the host-name into an IP address. I notice that ubnt.aqtsolutions.com does not resolve, but the other two names do. It may be that your nginx configuration is fine and you just have a missing DNS entry.


3

Cloudflare has these ip ranges, you can use nginx built-in real_ip module and setup headers properly https://www.cloudflare.com/ips set_real_ip_from 204.93.240.0/24; real_ip_header CF-Connecting-IP; https://support.cloudflare.com/hc/en-us/articles/200170706-Does-CloudFlare-have-an-IP-module-for-Nginx-


3

Because you regex doesn't match. ^[A-Za-z0-9]$ matches URIs composed of one alphanumeric character and you didn't put any leading slash nor capture group. You need ProxyPassMatch ^/([A-Za-z0-9]+)$ https://example1.com/news-$1 instead.


3

The Via header is designed for passing the blame on to someone else. It is perfectly acceptable to remove, or not generate it, if it doesn't serve that purpose.


3

Nginx is being stopped from binding to SELinux pop_port_t ports. It possible is to alter the desired ports to be a type that nginx can bind to, e.g. http_port_t. # for port in {143,993,110,995} ; do semanage port -m -t http_port_t -p tcp $port ; done && semanage port -l -C SELinux Port Type Proto Port Number http_port_t ...


3

To start, I would set up Nginx as a reverse proxy to the third-party server. You can read about how that works here: http://nginx.com/resources/admin-guide/reverse-proxy/, an example setup might look like: server { listen 80; server_name example-proxy-domain.com; location /some/path/ { proxy_pass ...


3

After some digging, I found something similar that just nails it. I found obscure tutorials, even bad links on the Apache doc section. So, for everyone who really doesn't care about Apache ins-and-outs, but just wants their Rails apps to fly with reverse proxy on the Bitnami Rubystack. Include the vhosts in the main configuration file (httpd-conf) Add your ...


3

Apache would see the IP address 192.168.0.123 as the source and that needs to be added the RPAF_proxyips directive, this tells mod_rpaf that its a known proxy. Quoting from http://www.stderr.net/apache/rpaf/ It changes the remote address of the client visible to other Apache modules when two conditions are satisfied. First condition is that the remote ...


3

Yes, Squid will cache the reponses from the back-end server(s) using the conventional method of interpreting the headers the back-end server sends with each response. A typical response for dynamic contents that shouldn't be cached looks something like: Expires: Fri Jul 25 10:19:36 CEST 2014 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: ...


3

Edit: (1) Sorry, some typo here (2) I adjust regex so it matches one or more slash before string mybucket like your log above. Well, maybe you mean something like this location ~* ^/https://s3\.amazonaws\.com/+mybucket(.*) { ... proxy_pass http://s3.amazonaws.com/mybucket$1; }


2

Identifying the type of request and forwarding it based on that cannot be done at the TCP level. By the time your gateway need to decide which host to NAT it to, the request has not been sent yet. On the application layer, you have more possibilities. This will be protocol dependent and is only possible for some protocols. An HTTP proxy is one example doing ...


2

You should learn how Nginx handle location. See this old wiki or new one or this blog. The summary: There are 4 types of location rule, and are applied with the following priorities: Exact matches: There can be only one exact match – the clue is in the name!. For example: location = /foo/bar High priority prefix: There can be more than ...


2

Both location directives need to be in the same vhost configuration. Different vhosts are meant to allow different host names and/or protocols to be served by the same server. What you have done effectively is to create two vhosts, but without a means to differentiate the two, e.g. with the server_name directive. Since it can't differentiate them, nginx ...


2

Turned out not to be a problem with the nginx conf - that was fine. The problem is due to the fact that Chrome only allows setting of cookies from fully-qualified domain names, not for IP addresses https://code.google.com/p/chromium/issues/detail?id=56211 I bought a domain name, applied it to my server, and it worked. It required one change to the nginx ...


2

Marko, maybe too late, but I was able to get nginx and wildfly working following your configuration, let me share that: In proxy_headers.conf: proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; add_header Front-End-Https on; In my app.conf location / { include conf.d/proxy_headers.conf; proxy_pass http://127.0.0.1:8080; } ...


2

I have been searching for a solution for this problem on and off for the last 16 months. But each time I look, it seems impossible to do this with the SSH protocol as specified in relevant RFCs and implemented by major implementations. However if you are willing to use a slightly modified SSH client and you are willing to utilize protocols in way that was ...


2

It has been 3 years since this question was asked and a lot has changed. This answer is to help anyone like me. The current version of nginx allows to create multiple sub filter rules under one location directive. Like so location / { resolver 8.8.8.8; proxy_pass http://original-domain.com; proxy_set_header Accept-Encoding ""; proxy_set_header ...


2

You can just use the stunnel service in client mode to listen for unencrypted traffic at localhost and then pass it on to the SSL backend. Example configuration: [gmail-pop3] client = yes accept = 127.0.0.1:1110 connect = pop.gmail.com:995 Then point nginx to localhost:1110 as backend and it will in fact connect to GMail's POP3 server over SSL.


2

I have another way to achieve this, If you have have several things to upgrade on each server. That'll be very wasting to update 5 server for the same operations. Create a Load Balancing & Scaling Group.Ensure the connection draining is enabled. There's my upgrade step. Remove 1 instance from your load balancer. Update everything you need. And ...


2

As far as I know, AWS does not have a built-in implementation for reverse proxy, even for ELBs. You can use Apache, Nginx or HAProxy for a reverse proxy implementation, though.


2

The issue is that when you use a trailing slash with the proxy_pass directive, the default behaviour for proxy_redirect is that the following : location /test/ { proxy_pass http://192.168.1.202/; proxy_set_header Host $host; } Is the same as : location /test/ { proxy_pass http://192.168.1.202/; proxy_redirect http://192.168.1.202/ /test/; ...


2

You'll need to clarify what you're trying to achieve. With a reverse proxy, the user connects to only the abc123.com server. When they request something within /blog, the abc123.com server makes a connection to the abc123blog.com server, makes a request, gets a response, then feeds that response back to the user. If you're trying to encrypt the user's ...



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