w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
nginx proxy pass to sslv3 upstream
Have you tried "ssl_ciphers ALL;"? Although that's not recommended (because that allows weak ciphers), that shall narrow down the scope of the problem. If that doesn't work, most likely the cause of your problem is that the openssl you use doesn't have the suitable ciphers to complete the SSL handshake with your Go server. Note that Go's tls package is only "partially" implemented and the supported ciphers is very limited. There are two solutions: You'll have to upgrade your openssl version that supports what Go's tls package already implemented. And then, of course, recompile your nginx. You'll have to patch tls package to support whatever your current openssl ciphers provides by adding the appropriate suite ids to cipherSuites in tls/cipher_suites.go (I think)

Categories : Ssl

NGINX Reverse Proxy for upstream Django/Gunicorn Backend
Proxy Buffering Generally proxy buffering is only going to help you if you're generating very big web pages, or sending large files. regardless, it's pretty easy to set up, but you will need to tune the buffer sizes to about the size of your largest pages +20% (Any page that doesnt fit in the buffer gets written to disk), or selectively enable proxy buffering on your largest pages. docs: http://wiki.nginx.org/HttpProxyModule#proxy_buffering Caching I don't know much about your app and how dynamic it's content is, but setting up correct Cache Control/ETAG header generation on your app will be the first thing you'll want to look at. This is what will let Nginx know what is safe to proxy. Also, you may wish to setup multiple cache zones to manage the amount of space your caches take on di

Categories : Django

Why doesn't Nginx load balancing balance bandwidth?
It sounds like the configuration is doing exactly what you asked it to do. You configured a proxy on the first server IP, right? So data has to go from the user to the proxy, then to the server, then the reply from the server back to the proxy and then to the user. It's triple because the first server sees three flows (both servers' output from the proxy and the second server's input to the proxy) while the second server sees one (its output to the proxy). It is perfectly balancing the traffic into equal flows, the first server just sees three flows and the second just one. As for how you fix it, it depends what's wrong with it and what you're trying to accomplish, which you haven't told us.

Categories : Nginx

NGINX: upstream timed out (110: Connection timed out) while reading response header from upstream
Might be worth the look http://howtounix.info/howto/110-connection-timed-out-error-in-nginx (he put the proxy_read_timeout in the location block

Categories : Nginx

Nginx upstream configuration
Then these can help, check the proxy_next_upstream These directive determines in what cases the request will be transmitted to the next server. Your server block should look like for example: server { location / { proxy_pass http://appcluster; proxy_next_upstream error timeout http_404; } }

Categories : Linux

Web.py routing when added nginx as upstream
I figured out what was going on just before posting but I hope I can help someone else by posting this anyway. web.py is sending the matched group to the GET and therefor using (.*)/data/(.*) sent both the start and the end of the path to the GET which is why it failed. Setting the route to .*/data/(.*) gave me what I was after and only sent the part after data to the GET function.

Categories : Python

Can a server run Nginx for some sites and Apache Nginx Reverse Proxy for others?
server { server_name example.com; location / { # assuming apache is on port 81 for example proxy_pass http://127.0.0.1:81; # to make apache detect the host header proxy_set_header Host $host; } # if you have assets folders, you can let nginx serve them directly, # instead of passing them to apache location /images { # or /css or /js .. etc try_files $uri =404; } } Note: in the case of assets, sometimes some sites serve assets through rewrites, or even handled by the application it self, you can pass it to apache by adding that in the assets location as a fallback like this location /images { try_files $uri @apache; } location @apache { proxy_pass http://127.0.0.1:81; } In apache you create a virtual host <Virtua

Categories : Apache

Redirect request to two Upstream server in Nginx
Here's how i think your config could be, you can create multiple upstreams upstream main_upstream { server IP1 server IP2 server IP3 } upstream process_upstream { server IP2 server IP3 } server { location /process { proxy_pass http://process_upstream; } location / { proxy_pass http://main_upstream; }

Categories : Nginx

nGinx rewrite if previous rewrite did not find any file
I know you seem to have figured it out, but i would like to suggest a simpler answer, might need some fixing but you'll get the idea, Note: I haven't tested those. location ~ /(?:images|stylsheets|scripts) rewrite ^(.*)$ /assets/$1; } or maybe location ~ /(?:images|stylesheets|scripts) rewrite ^ /assets$request_uri; }

Categories : Nginx

Amazon web service load balancer unable to balance the load equally
There could be a number of reasons for this. Its without doing more digging, its hard to know which one you are experiencing. Sticky sessions can result in instances traffic becoming unbalanced. Although this depends heavily on usage patterns and your application. Cached DNS resolution. Part of how the ELB works is to direct traffic round robin on a DNS level. If a large number of users are all using the same DNS system provided by an ISP, they might all get sent to the same zone. Couple this with sticky sessions and you will end up with a bunch of traffic that will never switch. Using Route 53 with ALIAS records may reduce this somewhat. If you can't get the ELB to balance your traffic better, you can set up something similar with vanish cache or other software load balancer. Not as c

Categories : Amazon

Load Balance wso2 ESB
You can add following parameter to http and https transport receivers of WSO2 ESB . <parameter name="WSDLEPRPrefix" locked="false">[load-balancer-url]</parameter> For example: <parameter name="WSDLEPRPrefix" locked="false">http://esb.cloud-test.wso2.com:8280</parameter> You need to edit following file. <WSO2-ESB-HOME>repository/conf/axis2/axis2.xml This step is necessary for configuring WSO2 ELB also. See following ELB doc for more information. http://docs.wso2.org/wiki/pages/viewpage.action?pageId=26839403

Categories : Wso2

Load Balance: Node.js - Socket.io - Redis
Redis only syncs from the master to the slaves. It never syncs from the slaves to the master. So, if you're writing to all 3 of your machines, then the only messages that will wind up synced across all three servers will be the ones hitting the master. This is why it looks like you're missing messages. More info here. Read only slave Since Redis 2.6 slaves support a read-only mode that is enabled by default. This behavior is controlled by the slave-read-only option in the redis.conf file, and can be enabled and disabled at runtime using CONFIG SET. Read only slaves will reject all the write commands, so that it is not possible to write to a slave because of a mistake. This does not mean that the feature is conceived to expose a slave instance to the internet or

Categories : Node Js

NGINX Proxy to Cloudant
I found the issue. The innocuous looking rewrite rule as the first line rewrites the $request_uri and changes the $uri variable as part of request fulfillment. $request_uri is not changed by rewrite. So when I included that variable in the proxy_pass location, I was not properly including the edited url with the /couchdb/ removed. Changing the proxy_pass line to: proxy_pass http://myusername.cloudant.com$uri; Now works without issue. This was not an SSL problem nor a problem with Basic Authentication nor other http header issue nor a problem with Cloudant. This was all related to the URI I was forwarding my request to.

Categories : Nginx

Azure windows virtual machine load balance
You need both the virtual machines to be under the same cloud service. Only then you get the option to load balance them. There is no way add existing VMs to the same network. there are operations in the Service management API (usable through powershell) to create a new VM. You can use that to create a fresh VM from your existing image and connect it to the same service as your first VM. Then you'llhave the necessary options enabled for load balancing.

Categories : Azure

Azure Traffic Manager Load Balance Options
Traffic manager comes into picture only when your application is deployed across multiple cloud services within same data center or in different data centers. If your application is hosted in a single cloud service (with multiple instances of course) , then the instances are load balanced using Round Robin pattern. This is the default load balancing pattern and comes to you without any extra charge. You can read more about traffic manager here: https://azure.microsoft.com/en-us/documentation/articles/traffic-manager-overview/

Categories : Azure

Need help creating reg-ex expression to rewrite path and filename using information in original path and file name
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^(ImageFolio4_files)/1/([^/]+)/((?!AM|tn_)[^.]+.jpg)$ /$1/cache/images/~$2~$3 [L,R=302,NC] Once you verify it is working fine, replace R=302 to R=301. Avoid using R=301 (Permanent Redirect) while testing your mod_rewrite rules.

Categories : Regex

Nginx proxy pass and url rewriting
The 1st way that I know of is using a regex against the $args parameter like so: if ($args ~ "^(w+)=") { Or the 2nd way is to use the convenient $is_args like so: if ($is_args != "") { Remember that in both styles you need to put a space between the if and the opening parenthesis; "if (" not "if(" as well as a space after the closing parenthesis and the opening brace; ") {" rather than "){". Full example using the 1st style above, nginx.conf: location ~^/static/photos/.* { include /etc/nginx/proxy.conf; if ($args ~ "^(w+)=") { rewrite ^/static/photos/(.*)$ /DynamicPhotoQualitySwitch/photos/$1 break; expires 7d; proxy_pass http://foofoofoo.com; } } Full example using the 2nd style above, nginx.conf: location ~^/

Categories : Nginx

Nginx proxy redirect without changing url
first you're using 8000 in proxy_pass, but you're mentioning your port is 8080. Second, remove the rewrite line should do the trick, because youre actually using the rewrite rule here and never get to the proxy_pass line. Something like the following should work: location /assets/ { include proxy_params; proxy_pass http://127.0.0.1:8080; } There are also proxy_rewrite and proxy_redirect commands which might help you in getting this upstream-redirect handled internally by nginx. Hope that helps!

Categories : Nginx

How to test nginx proxy timeouts
According to the docs the connect timeout cannot be more than 75 seconds, which may explain why it's timing out sooner than you expected. Not positive, however. I've never really done work with the low-level python sockets library so it may be accepting the connection into the pool at a low level before you actually call s.accept() in your program. Send timeout works by measuring time between two chunks of data heading towards the upstream server. Since you're sending the entire response in one chunk I'm guessing in your implementation you're hitting the read timeout again, rather than a send timeout. If you send one chunk, then wait past the send timeout to send the rest of the response and close the connection, you should hit the send timeout.

Categories : Python

How to move redmine to a sub-URI with nginx as a proxy
This is a pretty complicated thing to do. You wouldn't think so but it is. Every single redmine version that comes out has a different set of correct and incorrect ways of accomplishing this. For example, I have a working configuration with (nginx-1.4.1, unicorn, redmine-2.2.1) but now that I'm using (nginx-1.4.2, unicorn, redmine-2.3.3) that doesn't seem to work anymore. Here's some links that may be of use: http://www.redmine.org/issues/11881 http://www.redmine.org/issues/12102

Categories : Ruby On Rails

Gitlab 5.3 behind nginx reverse proxy
Assuming that the git daemon and the nginx daemon are on the same box I believe that the location block should be like the following: location ^~ /git/ { proxy_pass http://127.0.0.1/git; proxy_redirect http://127.0.0.1/git/ /git; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; }

Categories : Nginx

Does SQL Server Service Broker load balance when External Activator is used?
To utilise the built-in load balancing you would need to deploy the service to more than one sql server instance. I suspect that isn't quite what you are planning, so you will have to come up with a custom method, such as having an internal activated procedure that forwards your arriving messages into one of your four queues that the external activation processes look at.

Categories : Sql Server

I'm trying to rewrite a sef url into a plain url using nginx
you probably need to add a break at the end of the line rewrite ^/tools/app/(.*)$ /tools/app?action=$1 break;

Categories : PHP

Nginx rewrite in subfolder
Try this, I changed my answer to try to imitate the same behaviour you are using in your rewrite. location ~ /blog(.*) { index index.php; try_files $uri /blog/index.php?$1&$args; }

Categories : Wordpress

Rewrite old image url with nginx
If you want to use rewrite you need to use a full path to the new location rewrite ^/assets/avatar/avatar.png http://example.com/assets/avatar/newavatar.png permanent; A better way though is using a return location /assets/avatar/avatar.png { return 301 $scheme://example.com/assets/avatar/newavatar.png; } If you want to just rewrite, you need to change permanent to last or break

Categories : Nginx

Rewrite rule fir NGINX
this one is pretty simple, you just want to tell nginx to ignore the word blog ( and I'll assume it has to be followed with the word category1 ) rewrite ^/category1/(.*) /blog/category1/$1 last; # | | | | | | # [1] [2] [3] [4] [5] [6] [1]: URL begins with [2]: category1 [3]: capture all that follows [4]: add blog [5]: add the rest of the URL ( that we captured in [3] ) [6]: stop the rewrite and process the new URL and any other matching rewrites.

Categories : Nginx

How can I optimize this nginx proxy cache configuration?
A nested location is the right way to create locations with regular expressions and it should do the trick for what you want to achieve. location / { proxy_pass http://192.168.12.12:91; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location ~* .html$ { proxy_cache cache_one; proxy_cache_key $host$uri$is_args$args; proxy_cache_valid any 1m; expires 1m; } } I’m not totally sure if the nested location is really using the options from the outer location block. If it doesn’t (I can’t test this right now) you could create separate files. location / { include proxy.conf; location ~* .html$ {

Categories : Linux

How to configure proxy servers with puppet nginx?
Use nginx::resource::vhost The source of the repo you are using gives a breakdown of the commands you will need to use: https://github.com/puppetlabs/puppetlabs-nginx/blob/master/manifests/resource/vhost.pp

Categories : Nginx

When using NginX as a reverse proxy, how can i fallback to a maintenance url?
are you using the free version ? I think what you are looking for is in the non-free version called NGINX Plus. Advanced Load Balancing Application Health Checks

Categories : Nginx

nginx websocket reverse proxy configuration
This issue is related with the nginx version. Pleas check nginx -v, to check your version. The followings params are supported after the 1.4 version. # WebSocket support (nginx 1.4) proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; If you are using ubuntu you can install a newer version with this steps: First remove the old version (http://askubuntu.com/questions/235347/what-is-the-best-way-to-uninstall-nginx): sudo apt-get remove nginx sudo apt-get purge nginx sudo apt-get autoremove Then install a new version (https://launchpad.net/~nginx/+archive/development): sudo add-apt-repository ppa:nginx/development sudo apt-get update sudo apt-get install nginx

Categories : Nginx

nginx proxy based on host when using https
according to http://www.informit.com/articles/article.aspx?p=1994795, you should indeed have two "server" sections, with two different server names. In each one, you should include your ssl_* directives.

Categories : Ssl

nginx and trailing slash with proxy pass
Did you already try playing with server_name_in_redirect? However, I found you question via google because I run the same issue with the trailing slash. Nginx forces a 301 to the same URL with an trailing slash.

Categories : Http

how to internally load balance multiple instances of web/worker roles in Azure?
There is no internal load balancer in Windows Azure. The only load balancer is the one that has the public IP Addresses. If you want to load balance only internal addresses (workers) you have to maintain it yourself. Meaning you have to install some kind of a load balancer on Azure VM, which is part of the same VNet. That load balancer may be of your choice (Windows or Linux). And you have to implement a watchdog service for when topology changes - i.e. workers are being recycled, hardware failure, scaling events. I would not recommend this approach unless this is absolutely necessary. Last option is to have a (cached) pool of IP Endpints of all the workers and randomly chose one when you need.

Categories : Asp Net

Apache mod_rewrite to NginX rewrite help please
This mostly should do the trick, the problem would be on what exactly u want to be passed to index.php server { server_name example.com; root /path/to/www; location / { try_files $uri $uri/ /index.php$request_uri } } server { server_name www.example.com; return 301 example.com; }

Categories : Nginx

nginx rewrite module not working?
You seem to have mixed different bits from different how-to's, without understanding them. Observe: rewrite ^(.*)$ index.php?/$1 last; #question mark, typo? location ~ .php$ # matches end of request_uri fastcgi_split_path_info ^(.+.php)(/.+)$; # matches .php followed by a slash For the third statement to match, .php is never at end of request_uri, so this statement will never match in this location. Remove the question mark from the first statement, remove the dollar sign from the location. Then add: fastcgi_param SCRIPT_FILENAME $document_root$ fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_split_pathinfo; to the location block. Try to understand from the documentation and try to further restrict the location block.

Categories : Nginx

nginx rewrite secure link
I'd say change the /files block, because right now it's logical to return 403, because you just deny all. location /files/ { internal; } This would return 404 for non authorized instead of 403, don't know if that works for you.

Categories : Nginx

Nginx rewrite rules with try_files
If you need just to rewrite that one css.css file to wp-admin/admin-post.php?action=thesis_do_css then try this: if ($request_filename ~ wp-content/thesis/skins/classic-r/css.css ) { rewrite ^ http://mydomain.com/wp-admin/admin-post.php?action=thesis_do_css? permanent; } That should be within your server{ block. Make sure to change mydomain.com to your actual domain, of course. I hope that helps.

Categories : Htaccess

301 Rewrite Permanent Redirect in Nginx
In nginx change server_name from site1 to site2 and then create a new site1 block server { listen 80; server_name site1.com; location / { return 301 $scheme://site2.com$request_uri; } }

Categories : Nginx

NGINX rewrite rule with exclusions
Well i think one rule could handle all of this, but I'll assume a couple of things and you need to confirm it. for root location there's an index.php for /images and /file.html I'll assume that those files exist with the exact path and serve them, I'll explain more after i write the rules server { server_name mydomain.com; # maybe www.mydomain.com too index index.php; # or index.html, depending on ur app structure location ~ /(.*) { try_files $uri $uri/ /index.html?profile=$1; } } /images/image.png and file.php/file.html will all be matched by the first rule $uri, root will serve index.php (not very sure though) and when all fails (like your /something URL, it will try the /index.html?profile=something ps: I would have used $request_uri instead of $1 but it inc

Categories : Regex

nginx rewrite code for ZenPHOTO 1.4.5
Right now, i am using the following rules it works for me. location ~ .(gif|jpg|png) { try_files $uri @img_proxy; } location @img_proxy { rewrite ^(.*)$ /index.php?$1; } location / { try_files $uri $uri/ /index.php?$uri; } Note: It works for latest ZenPHOTO 1.4.5 version and i didn't check old versions.

Categories : Nginx



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.