New answers tagged

0

There were a few things going on. location / was being cached which caught the traffic initially. Adding the following rules worked, but only after clearing the cache used initially for some reason I still have yet to figure out. location /broadcast/ { # Proxy proxy_next_upstream error timeout http_404; proxy_pass http://$host$request_uri; ...


1

If all the devices you want to access are behind a proper firewall, and you have a full infrastructure behind each one to support it, I'd go for Citrix VDI, and put a virtual desktop at each location so you could remotely connect for management and maintenance. In terms of monitoring, PRTG can do what you want. You can have remote probe devices ...


0

Given your current setup, there's really only one way you can do this, and I'm afraid you won't like it. The issue is that you need to have something determining the hostname in the request, before passing it on to the appropriate server. Unfortunately, that pretty much includes handling the actual SSL connection - and that, in its turn, requires having the ...


1

You simply need a new server block with the server_name set to the second domain and a proxy_pass in the location. If you need it to be https you can list either another certificate, or the same certificate if it has the correct alternate names. This is covered in the Nginx beginners guide. server { server_name example.com; listen 80; listen 443 ssl ...


2

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 of: server { server_name subdomain1.example.com; location / { proxy_pass http://hostname1:port1; } } server { ...


2

Pretty much the same way. location /foo { rewrite ^/foo(.+)$ /$1 break; proxy_pass http://foo; } location /bar { rewrite ^/bar(.+)$ /$1 break; proxy_pass http://bar; }


1

While both HAProxy and Varnish can load-balance, only one of them is built for it. You could just use Apache for your purposes as well since it can proxy and cache as well, but it's hardly an optimal solution. In my opinion, you're best to use each product for what it's best at. What I do is install both on the same box and configure Varnish to use ...


0

I'm glad you figured it out. When I started reading your question I was already thinking about the "session" I have a couple of Java applications running with reverse proxy in apache and it took me awhile to get them working properly.


0

EDIT: Nope, this didn't fix it. Though to be fair, the problem this time was that when I came back to it several hours later, a GET request was hanging. When I refreshed the page 6 times, it started working. I do have basic authentication on there too, however. Really not sure what's going wrong. PREVIOUS POST WHEN I THOUGHT I'D FIXED IT: Hmm, it looks like ...


3

Varnish does not support SSL Running a site/service on SSL is a necessity for anything half serious, so thats one reason to use haproxy which will do SSL termination for you.


-1

You can achieve this using a multiplexer: http://www.unixmen.com/sslh-a-sslssh-multiplexer-for-linux/


1

Your proxy redirect looks suspect. Have a look at the documentation, and also at the nginx beginners guide. Basically, try removing everything other than proxy_pass from your location. This is mostly a guess, but it's worth a shot.


0

@blueben is right. A specific and common example of what can happen when a reverse proxy is not used is that a backend database can run out database connection handles where there's no proxy and there's a traffic spike. This is due to the connections being slow to release as @blueben described. A first instinct to seeing database handles running out might ...


0

@naill Donegan mentions this in comment above, but it is important enough to warrant an answer. Nginx stops the slow loris attack that gunicorn doesn't handle.


1

1) Yes, mostly when apache handles slow HTTP clients: apache is designed in a way when its child blocks until he serves one client, thus its unable to serve others. So, if you have lots of clients, apache children will stack, consuming memory/CPU and probably hitting the children cap, making this situation a DoS. 1a) I see none. 1b) Yes, php module is way ...


0

It seems the issue comes from my registar. There was a time whereeverything was working but now I cannot even ping my domain. The A record wasn't setup properly.


0

You need SSLProxyEngine ON and a KeyFile


0

I'll post this as an answer because it's easier to format. Try this proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; proxy_cache_valid 200 302 60h;m proxy_cache_valid any 60m;


1

Instead of reverse proxying the "ip" address (proxy_pass http://127.0.0.1:9003), try proxy_pass http://YourHostNameBehindReverseProxy:9003. Then add YourHostNameBehindReverseProxy to /etc/hosts and associate with 127.0.0.1.


0

It's possible, and basic/common, to choose a backend based on the path in the URL. It's a bit more rare to make that truly directory based because normally proxying happens before requests are mapped anywhere on disk -- but it can be done with mod_rewrite and the [P] flag.


1

It's not clear what you have tried. The first thing I would try is a simple proxypass of /subN to a backend machine <VirtualHost *:80> ProxyPass /sub1 http://192.168.1.1/ ProxyPassReverse /sub1 http://192.168.1.1/ ProxyPass /sub2 http://192.168.1.2/ ProxyPassReverse /sub2 http://192.168.1.2/ ServerName example.com ...


1

With you new (EDIT1) config, any access to machine #2 using http (as opposed to https) will be proxied. Which eliminates the original "Welcome to nginx!" side-effect, which was (probably) caused by a redirect to http scheme. Moving on, I think the root of the problem is machine #3 (the real server 1) generating a redirect which is not being mapped correctly ...


0

Yes. By default, nginx will cache the request body. So if you're uploading 50 GB across 5 servers then your reverse proxy will have to store all 50 GB. (assuming the uploads are going on at the same time) You can disable this using the proxy_request_buffering directive. Read the documentation for details on how to configure it as there are some limitations: ...


1

you are close, but there's no reverse proxy for http configured, only for https (in the above setup) — so it should show default content from document root. First server also lacks ending }. You may configure both http and https in the same block, just use the ssl keyword in the listen directive (under the ssl port, so there's no need to set the ssl on ...


0

Your post is moderately unclear. I don't think you're referring to nginx fastcgi caching, but you could be. Nginx does what you tell it to do. If you're using proxy_pass then my understanding is it just passes the connection to the next server, it doesn't receive the upload then send it on itself. ie nginx acts like a connection proxy. If you're talking ...


0

I've finally solved the issue. The breakthrough occured when I followed @john ktejik's directives: http://stackoverflow.com/questions/4390134/failed-to-load-resource-under-chrome/26742627 I came to realize that the involved resource was encompassed within a .jar file. Therefore, I had to tell Apache2 to explicitely use "SetOutputFilter ...


1

There is no need to put nginx or any other form of load balancer in front of your border SMTP servers. If you don't get the configuration right, it is likely to hurt your ability to successfully deliver mail. Just put your servers in your DMZ. Incoming traffic will be part way through a conversation before you can route it appropriately. IMAP users will ...


0

The solution to my problem is the !. ProxyPass /webshare !


0

This question is very old, but it is still relevant and unanswered. I just spend several hours finding a solution to this, Nginx from v .1.9.7, include a new feature which do exactly what you want. Add this to your config: proxy_cache_convert_head off; proxy_cache_methods GET HEAD; proxy_cache_key $scheme$request_method$proxy_host$request_uri; The first ...


1

This is one of the scenarios Nginx explicitely supports, and you would most likely see at least some performance gains due to the improved pipelining, having only a single TLS session to negotiate, etc... assuming your application's architecture is such that it would profit from those benefits. However, beware that some of the oft-used HTTP 1.1 hacks you ...


0

There isn't anything wrong with the code, the server_name is set correctly from what I can see. If you're accessing IP address of the server, than it wouldn't be served as NGINX is (in your configuration) only configured to display content from "jira.domain.com". By the way, could you elaborate a bit? How about the rest of the configuration, if it's ...


0

It should be possible, try something more like this. I see things missing, and things that look a bit odd, like the ":w" at the end of one line. This first part goes outside your server block fastcgi_cache_key "$scheme$request_method$host$request_uri"; # Determines in which cases a stale cached response can be used when an error occurs during # ...


1

You would need to create two separate Virtual Hosts, with the different ports you want. You would need <VirtualHost *:8080> ... </VirtualHost> <VirtualHost *:3000> ... </VirtualHost> You also will need to set Apache Listen directives for both those ports Listen 8080, 3000


0

Try this: http { map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 80; listen 443 ssl; server_name rstudio.example.com; root /usr/lib64/rstudio-server/www; include /etc/nginx/ssl/rstudio.ssl.conf; location / { proxy_pass http://192.168.1.94:8787; proxy_redirect ...


0

From my research, it doesn't look like this is a simple config file problem. Squid has to be compiled using a --enable-ssl flag, and this appears to be fairly difficult with Debian based distros. It looks to me like squid is more ideal for RPM based distros. See here for more info. I'm going to mark this as an answer for now, unless someone posts ...


0

I don't see how the proxy server will help, if all the pages have to be sent from Europe. It's just another hop with no benefits. You already have static resources on a CDN in the USA. If it's only one page hit of up to 180ms and all other resources are cached I think that's probably ok, it's if there's multiple hits on your server that it could be an issue ...


-1

IF 70% of the traffic is in US then it would make great sense to place the app server here. From that point using some HA delivery system would be advisable. I have a set target for experience of under 1 second for my app to service a client. Whatever needs to happen to make that target is my job.


3

You could use multiple A records, one for each machine. But, regarding your high-availability tag: You won't get this via this technique. Alternatively, you could use Anycast or a Content delivery network aka CDN. SSL may be an issue. Basically can 1 cert work on multiple servers provided they have the same setup? Yes.


1

I think you possibly need a content distribution network, rather than another web server trying to serve the same domain. There are a number of CDNs, including CloudFlare, MaxCDN, Amazon CloudFront, Akami, etc. CloudFlare has a free tier which is adequate for some, plus business plans. A CDN can cache pages if it's set up properly. If you want two web ...



Top 50 recent answers are included