w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

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

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: Response handling and Reverse Proxy with Cache
Actually, location.capture is not designed to do things you doing, but, if I get you correct (you want to send headers that browser send you to subrequest) you, probably, can hack it around using ngx.ctx + set ;) But I'd say it is a very dirty kludgy way.

Categories : Nginx

Nginx as reverse-proxy: serving files without extension
The problem is, that you need something to identify the files without any extension. A sub-directory or something that’s always present within the request. Your regular expression only matched for requests that start end end with a dot (e.g. http://example.com/.). The following server configuration assumes that all URLs start with storage, as this would be the only possibility to identify those files. Please note that I’m using the try_files directive to rewrite the internal path where nginx should look for the file. The root directive is not meant for what you want to achieve. And last but not least, you should always nest location blocks with regular expressions. There is no limit in the nesting level. nginx will create some kind of tree data structure to search for the best matchi

Categories : Nginx

Find and Replace with Nginx Reverse Proxy setup
It's not ideal, as really the source should be rewritten, but you can use sub_filter to rewrite the content of responses for proxied requests. With your example this would be: location /something { ... sub_filter '(111) 123-4567' '(222) 765-321'; sub_filter_once off; } The default behaviour of this is to replace once (which I have disabled in the example) and to only apply the changes to html pages (this is based on the mime type of the response). This is suitable for using in a reverse proxy as it can replace the Location header with the default options, and links when you disable the sub_filter_once option. While this module is not available unless explicitly configured at compile time, it is my experience that any package manager installed nginx has this option enabled.

Categories : Search

Extract port number from URL and reverse proxy with Nginx
This may be helpful: server { listen 80; server_name test1.test.com; location ~ ^/app/(.*)$ { proxy_pass http://192.168.154.102:$1; } } Notice: If you visit test1.test.com/app/8081, nginx will pass the request to http://192.168.154.102:8081/app/8081. More information about proxy_pass

Categories : Nginx

Can't update/install using composer behind a corporate firewall
I confirm being able to clone/pull/push a GitHub repo behind a firewall. And you do need https_proxy in addition of http_proxy: set http_proxy=http://<login_internet>:<password_internet>@aproxy:aport set https_proxy=http://<login_internet>:<password_internet>@aproxy:aport set no_proxy=.company (the no_proxy part is there to avoid using the proxy for internal url, internal to the company)

Categories : PHP

Forward ssh protocol via ssh tunnel | corporate firewall
Disclaimer: If this kind of connection is allowed ask your security people to enable it for you. If it is not allowed and you nevertheless use some tunneling to circumvent the security concept of your company you will get a lot of trouble! Be warned. You already managed to get to your router. In this case I would use ProxyCommand ssh router nc -w1 %h %p in your .ssh/config. This will first open a ssh connection to you router and connect to the actual target host and then start the actual ssh connection. Also git should work with this kind of setup.

Categories : GIT

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

How do I configure NPM to Trust the firewall issuer for HTTPS proxying?
Found the solution... (Ignoring SSL Certs) npm config -g set strict-ssl false Thanks to this thread in google groups.

Categories : Node Js

nginx reverse proxy to access a backend webcam server that requires 2 ports for the URL
You can use this configuration file Proxy pass server for your first port server { listen 80; server_name localhost; #ssl configuration begin ssl on; ssl_certificate /usr/local/nginx/conf/cert.pem; ssl_certificate_key /usr/local/nginx/conf/cert.key; keepalive_timeout 70; #ssl configuration end #proxy pass proxy_pass http://192.168.1.7:70/url$request_uri;//70 is your first port proxy_set_header X-Real-IP $remote_addr; proxy_set_header Request_Uri_X $request_uri; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } Proxy pass server for your second port server { listen 81; server_name localhost; #ssl configuration begin ssl on; ssl_certificate

Categories : Nginx

How to properly setup nginx as a reverse proxy for gunicorn and flask using subdomains, for both SSL and non-SSL configurations?
server { listen 80 default_server deferred; listen 443 default_server deferred ssl; listen [::]:80 ipv6only=on default_server deferred; listen [::]:443 ipv6only=on default_server deferred ssl; server_name example.com www.example.com testing.example.com; root /path/to/static/files # Include SSL stuff location / { location ~* .(css|gif|ico|jpe?g|js[on]?p?|png|svg|txt|xml)$ { access_log off; add_header Cache-Control "public"; add_header Pragma "public"; expires 365d; log_not_found off; tcp_nodelay off; open_file_cache max

Categories : Python

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

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

How to use nginx as reverse proxy to direct localhost:9292 to a sub domain foo.localhost/?
If foo.localhost is your sub domain name and you want to proxy pass sub-domain to main-domain, you can use proxy_pass and you can learn a little more about server directive if needed. An example: server { listem 8080; host sub.main.com; ... location / { proxy_pass http://main.com; break; } } server { listen 8081; host main.com; ... location / { //do something } } This is proxy pass, means when access sub.main.com, actually it finally dealt by main.com, but the client side still shows sub.main.com. If you want client side shows main.com, here should use redirect but not proxy_pass.

Categories : Nginx

IIS URL Rewrite for Reverse Proxying two servers
in the action node's url attribute in your code--notice the colon followed by the slash. This means there is no port indicated, so the default port 80 is used. Basically, these examples are equivalent (so get rid of the unnecessary colon): http://test1/foo http://test1:/foo http://test1:80/foo So...what this rule says is for all URL's (because the match node's url attribute will match all values), forward all requests to the port 80 indicated in the action node's url attribute value. The match url value has to select only SOME requests (rather than ALL requests). And you'll need to write a second rule for the remaining requests. Your second rule might be your catch-all case, something like this will catch ALL requests that get that far: <rule name="ReverseProxyInboundRule2" stopPro

Categories : Ajax

Python object proxying: how to access proxy
The reason that your code goes wrong is the loop in __getattribute__. You want to override __getattribute__ so you can reach certain properties in the proxy class itself. But let's see. When you call p.value the __getattribute__ is called. Then it comes here if attr == 'value': return self.another_value(). Here we need to call another_value so we enter __getattribute__ again. This time we comes here return super(MyObjectProxy, self).__getattribute__(attr). We call the Proxy's __getattribute__, and it tries to fetch another_value in Myobject. So the exceptions occur. You can see from the traceback that we finally goes to return super(MyObjectProxy, self).__getattribute__(attr) that should not go to. Traceback (most recent call last): File "proxytest.py", line 22, in <module>

Categories : Python

Mixed content error when proxying websocket through nginx with SSL
Change match original protocol to match origin protocol: io.configure(function() { //io.set('match original protocol', true); io.set('match origin protocol', true); ... }

Categories : Node Js

Proxying WebSockets through node-http-proxy doesn't work
The core problem is that the master branch of node-http-proxy is only compatible with node <= 0.8.x (see https://github.com/nodejitsu/node-http-proxy#when-to-use-node-http-proxy): there's a tree that implements support for 0.10.x (see https://github.com/nodejitsu/node-http-proxy/tree/caronte) but it isn't the mainline branch and I haven't found any indication of when it will be merged in and available.

Categories : Node Js

Custom header or query string when proxying request from Nginx to HHVM?
Both will work for the foreseeable future. getallheaders() should work on all transport methods, even once we implement fastcgi, modhhvm, or our own libevent server. I personally dislike magic globals and prefer the function, but it is just personal preference. It could yield a perf improvement if we can analyze your code and see you never use a certain super global, we don't have to populate it.

Categories : PHP

Grails unable to download dependencies behind proxy and firewall
Generally it depends on the requirement of the application for dependencies. Ideally below items should resolve most of the dependencies (except if you want to refer some custom repo). //With reference to BuildConfig grailsCentral() - http://repo.grails.org/grails/core grailsPugins() - http://repo.grails.org/grails/plugins mavenCentral() - http://repo1.maven.org artifactory - http://repo.grails.org/grails Additional repos are are also mentioned in BuildConfig.groovy as commented in newly created projects. (check their validity) // uncomment these (or add new ones) to enable //remote dependency resolution from public Maven repositories //mavenRepo "http://snapshots.repository.codehaus.org" //mavenRepo "http://repository.codehaus.org" //mavenRepo "http://download.j

Categories : Grails

How to use reverse proxy on apache for a specific url?
Apache's ProxyPass directive seems to do what you're asking for. You could do something like this in server B configuration: ProxyPass /search http://server-A.example.com

Categories : Ruby On Rails

Reverse proxy with websocket mod_proxy_wstunnel
This line: ProxyPass /my_app/BasicWebsocketServlet ws://1X.X.X.1:8080/my_app/BasicWebsocketServlet retry=0 needs to come before this one: ProxyPass /my_app http://1X.X.X.1:8080/my_app Explanation (from https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass): Ordering ProxyPass Directives The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration. The first rule that matches wins. So usually you should sort conflicting ProxyPass rules starting with the longest URLs first. Otherwise later rules for longer URLS will be hidden by any earlier rule which uses a leading substring of the URL. Note that there is some relation with worker sharing. In contrast, only one ProxyPass directive can be placed in a Location block, and the most specifi

Categories : Apache

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

Is is possible to specify (fake) a User Agent using IIS Reverse Proxy?
The solution was simple enough. In IIS in the URL Rewrite configuration slick View Server Variables... in the right hand column. Click add and enter the name of the Server Variable - in this case HTTP_USER_AGENT. This will allow you to use and/or modify this specific server variable during the routing process. This is the step that I had missed, or gotten wrong before. To my knowledge this can't be done in the web.config file. I'm sure there's a command line to do it, but I don't know that. After adding HTTP_USER_AGENT to the allowed server variables list it is just a matter of setting that either through IIS or in the Web.config file add the desired value to the server variables section. <rule name="..." enabled="true" stopProcessing="true"> <match url="[pattern]" />

Categories : Dotnet

infinite timeout for reverse proxy in Apache
I experienced a similar issue with Nginx and solved it the same way as you did. But I changed the timeout to 1 day as it was sufficiently large in my case. I think you cannot do away with this. The rationale behind this is that Apache (or any proxy server for that matter) has to maintain its performance, which it clearly can't if it has to hold stale or inactive connections. You'd rather let your proxy server proxy more active connections than inactive connections. Therefore, there is no way to turn off the ProxyTimeout in Apache or even in Nginx (configured using proxy_read_timeout). So if your proxied server is not sending any response within the timeout, then either your application server is taking too long to respond or there is something wrong with your application server or the cl

Categories : Apache

Wordpress behind reverse proxy admin issues
$_SERVER['REQUEST_URI'] do not contains the full URL, so you should replace only /wp-admin/. Given your example: $_SERVER['REQUEST_URI'] = str_replace("/wp-admin/", "/blog/wp-admin/", $_SERVER['REQUEST_URI']);

Categories : Wordpress

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

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

My Apache Reverse Proxy is not returning the correct URL when using ProxyPass
Solved: #REDIRECT for http://sysaid.external.com <VirtualHost *:80> ServerName sysaid.external.com ProxyPreserveHost On Redirect / https://sysaid.external.com </VirtualHost> #https://sysaid.external.com <VirtualHost *:443> ServerAdmin webmaster@external.com ServerName sysaid.external.com SSLEngine on SSLCertificateFile /usr/local/etc/apache22/ssl/webmail.external.com.crt SSLCertificateKeyFile /usr/local/etc/apache22/ssl/webmail.external.com.key ProxyPreserveHost On ProxyPass / http://srv-01.internal.local/ ProxyPassReverse / http://srv-01.internal.local/ ProxyPassReverse / http://sysaid.external.com/ </VirtualHost>

Categories : Apache

Node reverse proxy basic routes issue
I don't know if you've found a workaround for this by now, but I had the exact same problem and think I've worked it out. When you hit the target endpoint directly localhost:9000 the path is sent through as /, ie just the root. Then when it requests the css etc, it resolves those as expected, from the root. When you call via the proxy localhost:8000/myapp it routes /myapp to the target and then passes the target service / as the path, at which point it behaves exactly as above. The problem here is actually at the browser. Because the path is specified as /myapp, it assumes that "myapp" is a filename. Then when it requests the css etc, it peels that back to the last slash and uses that as the base for all relative hrefs, which is why it then asks for /styles/blue.css and not /myapp/st

Categories : Node Js

Reverse proxy to CouchDB hangs on POST and PUT in Node.js
request makes get requests by default. You need to set the method. app.all(/^/db(.*)$/, function(req, res){ var db_url = ["http://localhost:5984/db", req.params[0]].join('/'); req.pipe(request({ url: db_url, method: url.method })).pipe(res); }); (code untested, let me know if it doesn't work, but it should be close)

Categories : Node Js

winnovative pdf https images broken, reverse proxy
Winnovative support helped me understanding I had to use http://localhost/myapp base url. Since pdf converter sits on server, it works locally. Second, I had to upgrade to v9 and it's ok.

Categories : Pdf

ngixn conditionally reverse proxy or serve directly
The basic solution is, make nginx as a reverse-proxy with fail_timout, when it receives a request, it dispatch to the upstreams where Ubuntu has higher priority, and if Ubuntu is offline, RPi will handle the request by itself. This requires: mysql can be access by two clients with different ip, which is already supported; wordpress should be the same for RPi and Ubuntu, which can be done by nfs share; nginx should be correctly configured. Below is the details of configuration. Note, in my configureation: RPi's IP is 192.168.1.100, Ubuntu's IP is 192.168.1.101; The wordpress only allows https, all http requests are redirected to https; Server listens at port 80 and 443, upstreams listen on port 8000; Mysql Set bind-address = 192.168.1.100 in /etc/mysql/my.cnf, and make sure skip-

Categories : Wordpress

Connecting a reverse proxy to a database mapping subdomains to IPs
I found the answer to my own question, it's called mod_proxy_express and it's available in Apache 2.4.

Categories : Database

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



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