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

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

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

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

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

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

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

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

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

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

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example: passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5; passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

Categories : Ruby

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

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

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

Node.JS reverse proxied with Nginx on diffrent machines
As I understand your question, you serve static content from your Node app. Better way is to move your static content from your Node app and let Nginx serve the static contents. Simply copy your static content (eg. /js, /css, /images) into your nginx www directory. In your case you will get also much better performance and you will save your raspberry resources. If it will interfere with your existing www content, move them to extra directory (eg. /assets/js, /assets/css, ...) and change your html accordingly.

Categories : Node Js

Joomla 3.1 setup on Ubuntu 12.04 running nginx
The permissions when t3 installs are correct, it sounds like the problem is with ownership rather than permissions. I think in ubuntu the system user is www-data so you would need to run the following over ssh chown -hR www-data:www-data /path/to/joomla/root Then upload the plugin through the joomla installer (and change folder permissions back to 755 and files to 644).

Categories : Joomla

Proxy a Flask app running on gunicorn to a subpath in nginx
I solved my problem: The snippet http://flask.pocoo.org/snippets/35/ does work, I was so stupid to have absolute URLs in my templates. I changed that to url_for() and now it works like charm.

Categories : Nginx

Nginx(proxy) + Apache: two process listening same port
Your problem is simple, you seem to have both nginx and apache listening on port 80, so nginx finds the port already in use, you need to move apache to another port, like 81 for example, and make nginx listen on 80, because it's the one which is going to receive the http requests and proxy it.

Categories : Linux

502 Bad Gateway in node + nginx proxy setup on Heroku
I am not really familiar with Heroku, and pretty new to Nginx, but I'll give it a shot: To me it looks like the Nginx-config is saying that Nginx and the node.js app are using the same port (<%= ENV['PORT'] %>). What you want is Nginx to listen to incoming connections (usually port 80), and have it forward them to the node.js app. Here is an example Nginx config: # the IP(s) on which your node server is running. I chose port 4000. upstream xxx.xxx.xxx.xxx { #Your IP adress as seen from the internet server 127.0.0.1:4000; #Your local node.js process } # the nginx server instance server { listen 0.0.0.0:80; #Have Nginx listen for all incoming connections on port 80 server_name my-site; access_log /var/log/nginx/my-site.log; location / { proxy_set_header X-Real-IP $remote_addr; proxy_s

Categories : Node Js

How do I make nginx proxy some urls on a domain to one location and the rest to somewhere else
You can refer to "rewrite" and "proxy_pass" directive in nginx manual and this can be solved easily: location ~* "^/$|^/(a|b|c).*?$" { rewrite "^/(.*)$" /site/$1 break; proxy_pass http://127.0.0.1:8001; ......; // to add any commands you need break; } location / { proxy_pass http://127.0.0.1:8002; ......; // to add any commands you need break; } Because no rewrite directive wrote in server block, Nginx start to match url in location phase. If is is caught by one location (here using the 1st one as example), then enter into rewrite loop. "break" in the end of rewrite means jump out the rewrite loop. Then start dealing with other directives in this location ,here proxy_pass will be dealt with. General process in this case would be: location match --> rew

Categories : Nginx

Websocket location mismatch when Safari 5.0 connects via nginx https proxy
Nginx websocket proxy only works for RFC6455 compliant handshakes. The older draft 75/76 handshakes, found in Safari 5 and old versions of chrome can't be proxied through nginx. Some more details here: Nginx: Reverse proxying WebSocket Draft 76

Categories : Nginx

Have you managed to make your node nginx proxy setup on Heroku work?
This article contains instructions on setting up nginx as a proxy on Heroku, in conjunction with OpenResty, Lua, and LuaRocks. node.js isn't mentioned. It uses this buildpack. Haven't tried it myself but seems someone has got it working.

Categories : Node Js

Joomla CiviCRM add duplicate field in joomla front-end profile form
CiviCRM does not support adding multiple website fields into a profile. You can add a custom field to the profile to hold an additional website. If you want to write a little code you can sync that to the website field with a hook. See Hook Reference as well as Example Joomla Hook Plugin Setup

Categories : Joomla

nginx + passenger + rails: do I need to start the rails server or just start nginx?
Set nginx to forward to my rails server using this https://gist.github.com/jeffrafter/1229497 worker_processes 1; error_log /usr/local/var/log/nginx.error.log; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream dev { server 127.0.0.1:3000; } server { listen 80; # You could put a server_name directive here (or multiple) if # you have not setup wildcard DNS for *.dev domains # See http://jessedearing.com/nodes/9-setting-up-wildcard-subdomains-on-os-x-10-6 # If we choose a root, then we can't switch things around easily # Using /dev/null means that static assets are served through

Categories : Ruby On Rails

Cannot disable button in front-end for joomla 3.1.5?
These links are all control in Global Configuration > Article Options. If you have them set to off, then you need to LOG OUT of the admin and then look at your page. They will be gone at that point.

Categories : Joomla

Joomla 3.1 Front end editing - Deleting and article
The Delete permission should be given only to trusted administrators (with intended access to the back-end) and can be performed in the back-end. From your description, you don't want this group of users to have access in the back-end and even more have delete permissions, as these users if they log-in to the backend they will be able to delete many things. These users should be able to edit state (publish/unpublish) their own articles. So, concluding: Give this group only front-end access, with permissions similar to the author (core joomla group) with the addition of edit state. So they will be able to create and publish/unpublish (**addition- or trashing) their articles.

Categories : Joomla

Upgrading Nginx 1.1.9 to 1.4.x
This is what test environments or virtual machines are made for. Your question is quite general and hard to answer this way. Try it out in a test setup. If you don't have that option, read the Changelog. From my experience, I haven't encountered backwards compatibility issues with configurations since 1.0 (before that even, but that's when officially configuration syntax should be considered stable). That's not to say there aren't any.

Categories : Ubuntu

Nginx and Unicorn Set up Not sure what I am doing
I've never used knife... It might be worth checking out this this blog post about setting up Capistrano, Nginx, and Unicorn - I've always found Capistrano to be a good deployment app (and there's lots of support for it, especially on SO). On Heroku, you don't deploy as you would with Capistrano or any other deployment utility - you simply push to a branch on your Heroku server. See: https://devcenter.heroku.com/articles/git for how to deploy on Heroku using Git.

Categories : Ruby On Rails

htaccess to nginx (help)
Please try the following: server { listen 80; server_name www.website.com; return 301 $scheme://website.com; } server { listen 80; server_name website.com; root /path/to/root; location / { try_files $uri @rewrite; } location @rewrite { rewrite ^/([a-z]+)/?([0-9a-zA-Z]*)/?.*$ /index.php?a=$1&q=$2 last; } }

Categories : Apache

Nginx add sites
well if you're going to use only 1 IP, then it's 1 server block ( 1 virtual host ) server { server_name [domain name or ip]; index index.html; # or php or whatever location /foo { root /var/www/foo/public_html; try_files $uri $uri/; } location /bar { root /srv/www/bar/public_html; try_files $uri $uri/; } } You haven't mentioned what kind of application this is, so it probably need some changes depending if its a php site or rails or any thing else, this would work for static content only like html and images.

Categories : Nginx



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