Tag Info

Hot answers tagged

12

1) How can I remove the [warn] and avoid buffering responses? Is it better to turn off proxy_buffering or set proxy_max_temp_file_size to 0? Why? You should set proxy_max_temp_file_size to 0 in order to remove it. The proxy_buffering directive doesn't directly related to the warning, instead it can switch off buffering at all, which only needed for ...


11

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 ...


8

I found what was the error, I needed to add proxy_ssl_session_reuse off;


6

I find clumsy wonderful : http://jagt.github.io/clumsy/index.html clumsy makes your network condition on Windows significantly worse, but in a managed and interactive manner.


4

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 ...


4

You express configured to serve path /index.html, but you requires /test-express/index.html. Either configure express to serve /test-express/index.html or make nginx to strip /test-exress from proxied request. Latter is as simple as add trailing slashes to location and proxy_pass. location /test-express/ { proxy_pass http://127.0.0.1:3002/; } See ...


4

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 { ...


3

It sounds as though you are speaking of a reverse proxy. The way this would work is that you would run the reverse proxy in your DMZ. You would give the URL of the reverse proxy to your outside users. When the users browse to the URL you gave them, your reverse proxy receives the connection and request. It then translates or rewrites or just forwards the ...


3

This doesn't work because the if is evaluated before the request is passed to the backend, so the $upstream_http_ variables don't have any values yet. add_header with an empty value is ignore, so you can use a map to conditionally add the header like so: map $upstream_http_strict_transport_security $sts { '' max-age=15552000; } server { location / { ...


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; }


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

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


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

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-


2

nginx added this as a new feature in development version 1.5.7. Add proxy_cache_revalidate on; to your proxy cache configuration, and nginx will revalidate stale content with If-Modified-Since.


2

Ideally you can redeploy your applications such that each application is installed in http://app<n>.com/app<n> instead of the document root. If not maybe you can have the links made relative, instead of linking to /images/logo.png link to ../images/logo.png or images/logo.png or ../../images/logo.png depending on the page that's served, which ...


2

Thanks for the hint to mod_filter. It seems to work now! I had a problem with the fact, that the site uses both, the url with www. and the one without. My configuration is: <VirtualHost *:801> ServerName www.dev.domain1.com ServerAdmin office@domain2.com SetEnvIf X-Forwarded-Proto https HTTPS=on FilterProvider gzinflate ...


2

Apache does have a module for this - it's called mod_filter.


2

Sorry to answer my own question, but I think this is worth putting out there for others info: When using Response.Redirect, outbound rules come into play. Viewing the requests with Fiddler helped work out what was going on with the links. Response.Redirect() was trying to send to /About.aspx (Transport in Response Headers). This was not being picked up by ...


2

I think you added something / extra in your config settings... Look at this line: proxy_pass http://IP_ADD_TOMCAT_SERVER:8080/; you need to remove the trailing slash and it should work fine. like this: proxy_pass http://IP_ADD_TOMCAT_SERVER:8080; try it out and see if things go fine!! Update#1 I just noticed that you have another mistake "same typo" ...


2

Actually you can do that via proxy_set_header. For more details look here: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header or see an example use-case here: http://stackoverflow.com/questions/12847771/configure-nginx-with-proxy-pass I have included the dynamic approach into your above posted configuration: server { listen 80; ...


2

You're not missing anything; you configured nginx correctly. The problem here is that WordPress thinks it should be generating HTTP links. When you try to access it via HTTPS, it still generates all of its links with http:// and thus they can't be loaded (without explicitly loading insecure content in the browser). There are WordPress plugins that will ...


2

Your approach is flawed. You do not want to use the domain names when configuring iptables. Your firewall has no notion of which domain a client has resolved to reach your hostsystem. All it sees are the IP address and port number. If you want to make the containers reachable via a public IP, you need to choose a distinct IP that is available on the ...


2

It's not IP as in IP address, but IP as in instruction pointer. You've encountered a bug in nginx. Consider upgrading, if you are running an outdated version. You could also file a bug report if you can tell what happened immediately before the segfault (check the rest of the log) or have a coredump (as long as there is nothing confidential on the ...


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

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

You can't do this with mod_rewrite, as that is only for requests. Further, operating on Location is not a 100% solution (that it would be pretty high), as it won't capture things like HTTP meta-refresh (not very common these days...), or instances where the URL is generated using client-side solutions (eg. Javascript, embedded content). Thus, the desire ...


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.



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