w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » NGINX » Page 1
What is "Reverse Proxy" and "Load Balancing" in Nginx / Web server terms?
Here is the basic definition: Reverse Proxy is a proxy host, that receives requests from a client, and sends it to one of the servers behind itself. Nginx and apache httpd are commonly used as reverse proxies. These are in the administrative network of the web server that a servers a request. This is in contrast with a (forward) Proxy, which sits in front of a client, and sends requests on behal

Categories : Nginx

whitelist cloudflare Ips with having ngx_http_realip_module enabled
Why not block these in iptables instead of in Nginx? Block the traffic before it even needs to be processed by Nginx (which will save resources). If you're going that route I'd be happy to share my iptables config (v4 and v6) for how to do it.

Categories : Nginx

phpmyadmin complains about permissions and open_basedir - but they all appear correct
Turns out this is a rather misleading message from phpmyadmin: Check group www-data has read access and open_basedir restrictions. But anyone running multiple sites, using php-fpm and concerned at all about security will have separate pools for each site. The solution, in my particular case was: chown -R phpma:phpma /var/lib/phpmyadmin chown -R phpma:phpma /etc/phpmyadmin chown -R phpma:phpma

Categories : Nginx

Variable interpolation inside Map directive
As stated in the map directive documentation : The resulting value can be a string or another variable (0.9.0).

Categories : Nginx

Error with IP and Nginx as reverse proxy
Maybe check this out http://forum.nginx.org/read.php?2,215830,215832#msg-215832 resolver 127.0.0.1; set $backend "foo.example.com"; proxy_pass http://$backend; In such setup ip address of "foo.example.com" will be looked up dynamically and result will be cached for 5 minutes.

Categories : Nginx

Nginx serving any domain with HTTPS to the default_server - How to stop it?
Your last block is conflicting with your first block. Defining a default server will make the server block process all unknown server names even if you define an other "catch-all" block. So the logic must be reversed to this : server { listen 80 default_server; listen 443 default_server ssl; ssl_certificate /path/to/certificate; ssl_certificate_key /path/to/key; return 301 ht

Categories : Nginx

Deploying Meteor to production with Meteor-Up, SSL and NGINX
For anyone coming across this in the future, I was able to solve things by removing the force-ssl package from my bundled meteor app. Apparently force-ssl and an NGINX proxy are either redundant or if used together can cause too many redirects. This was not well-documented in the materials I was able to locate. If there is a configuration that supports using force-ssl together with a proxy that

Categories : Nginx

Safari redirection adding comma causing 404
This definitely wouldn't be coming from CloudFlare's side unless you've manually created a PageRule to redirect content on your site. If you haven't manually created a PageRule at CloudFlare though you can rule out that as the location/cause of the issue. If you have created a PageRule at CloudFlare to redirect content I'd suggest opening a support ticket directly with CloudFlare so our support t

Categories : Nginx

How to load static files in an Nginx + Flask setup if the app is mapped to a sub-directory
This was because there an extra location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ { expires max; } inside the server block, I removed it and changed the permission of static directory by chmod -R 664 /the/path/to/static/dir chmod a+X /the/path/to/static/dir and it worked like a charm

Categories : Nginx

Greater than, Less than string Lua (Lapis)
It might be because you're viewing it in an application where the HTML tags are parsed. You'd need to escape the < and > characters: "&lt;a&gt;"

Categories : Nginx

Index.php automatically downloaded while installing opencart for the first time
It's not about Opencart installation, it's about executing php file on nginx, you should install php5-fpm and have correct configurations. More info at http://apmblog.compuware.com/2014/10/30/proper-configuration-running-php-nginx/

Categories : Nginx

new relic with multiple apps and multiple accounts in one server
You can separate sites into different New Relic accounts one of two ways: 1) You can setup virtual hosts in nginx, and add different New Relic license keys to each virtual host. There is an example using Apache on the New Relic docs site. 2) You can call newrelic_set_appname() via the API and change the account during the beginning of the transaction. For example: newrelic_set_appname("APP NAM

Categories : Nginx

Nginx config file
The answer is: There is a missing semi colon after index index.html And for those interested, you can set server_name to .project.ca instead of project.ca *.project.ca as they are both the same.

Categories : Nginx

Plesk - 502 bad gateway frequently
"(111: Connection refused) while connecting to upstream" this error means that something goes wrong with Apache or PHP-FPM(if you have using it), check apache logs of site where it happens: /var/www/vhosts/examples.com/logs/error_log

Categories : Nginx

configure nginx to get url from redis with key and proxy the url to other server
Take a look at https://github.com/openresty/lua-resty-redis. You will be able to get a key's value from redis in async. way. Here you may find the good example - http://openresty.org/#DynamicRoutingBasedOnRedis

Categories : Nginx

How to make nginx autoindex ignore certain files based on file extensions
You can use the Fancy Index module to achieve this. The fancyindex_ignore directive supports regular expressions which you can leverage to specify file extensions.

Categories : Nginx

NGINX- "set" directive is not allowed here
After months, an answer is coming :) Github configuration file seems wrong. set directive is used in server, location and if blocks. Syntax: set $variable value; Default: — Context: server, location, if http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#set Good luck!

Categories : Nginx

Cannot access nginx url within container
You have an ending slash in your proxy_pass. This means /graphite/ is passed to the backend. I suspect graphite is running from the root, so on the backend the uri is not found. See the documentation on proxy_pass: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

Categories : Nginx

How in Nginx to do rewrite without changing URL in address bar
This isn't possible, because you're changing hostnames. Browser security is tied to it, as is webserver configuration. You can rewrite URLs within same hostname, but changing hostnames requires redirect or using a frame.

Categories : Nginx

Why use gunicorn with a reverse-proxy?
According to the Nginx documentation, a reverse proxy can be used to provide load balancing, provide web acceleration through caching or compressing inbound and outbound data, and provide an extra layer of security by intercepting requests headed for back-end servers. Gunicorn is designed to be an application server that sits behind a reverse proxy server that handles load balancing, caching, and

Categories : Nginx

NGINX Error Code 502 / 503
The HTTP status codes you are asking about are all defined on the related Wikipedia page 502 Bad Gateway The server was acting as a gateway or proxy and received an invalid response from the upstream server. 503 Service Unavailable The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state. 504 Gateway Timeout The server was actin

Categories : Nginx

How to install codeigniter with easyengine?
(disclaimer: I am from EasyEngine team) I haven't used codeigniter but based on http://wiki.nginx.org/Codeigniter... You need to create a standard php/mysql site: ee site create example.com --php --mysql Later on it seems you need to make some changes to codeigniter config.php files based on above article.

Categories : Nginx

Nginx. How get whence there is a request
The question is not clear, but it seems you are trying to prevent hot linking when other website tends to load images from your web site without permission. The docs shows an example: valid_referers none blocked server_names *.example.com example.* www.example.org/galleries/ ~.google.; if ($invalid_referer) { return 403; }

Categories : Nginx

Nginx location: 403 error / File not found
Problems analysis The first golden rule is: nginx always serves request from a single location only. (Re-)read http://nginx.org/en/docs/http/request_processing.html. Based on your configuration: Requests to (www.)mydomain.com/php/<whatever> for files not ending with .php will be served by location /php/ from /var/www/mydomain.com/php/<whatever> Requests to (www.)mydomain.com/<w

Categories : Nginx

Nginx HTTPS redirect exception
At the end I will disable the HTTPS redirect for all and allow browsing also without the HTTPS. So what I did is to force the homepage to be HTTPS and the rest of link I print they are always HTTPS except that one I need that doesnt use HTTPS. I did this: ## we only force the HTTPS to the home page but we allow to browse without HTTPS if they want to. ## we only force the HTTPS to the home page

Categories : Nginx

Does nginx support rtmpt/rtmpts?
As per the author, no. https://github.com/arut/nginx-rtmp-module/issues/279 It's from Oct 2013, but I can't find anything else to contradict this.

Categories : Nginx

Nginx + iptables redirect and block
You almost certainly don't want to redirect traffic from all other ports to 443/8433. If you have a web application running on those ports then just configure nginx to listen there and block everything else with iptables. If you have connection attempts to your server on other ports then it could be anything - misconfigured software from anywhere on the internet, or someone port scanning, just b

Categories : Nginx

nginx - Create subdomain to youdomain.com/test.php?ìd=1234567
As an exception, you can use if. Note that the only thing you do in that block is issuing a return directive, which is a safe case for if. if ($host ~* (?<page>D+)(?<id>d+).yourdomain.com) { return 301 $scheme://yourdomain.com/$page.php?id=$id; }

Categories : Nginx

Nginx - how to correctly define root dir for location?
Founded solution! http://nginx.org/ru/docs/http/ngx_http_core_module.html#alias Result: location /upload/ { alias /home/site/upload/; }

Categories : Nginx

Kibana interface with ELK on virtual host
Usually you would point your browser at http://localhost:9200/ to browse Kibana but you need to work out the IP Address of your VM Box. You can run ifconfig on the ubuntu box to check the IP Address, which you can then hit. As per: http://superuser.com/questions/245156/how-can-i-connect-to-a-web-server-running-in-a-vm-when-the-vm-is-in-nat-mode

Categories : Nginx

nginx reverse proxy and static files
You don't understand how root works. Look at the documentation again and then try to understand why it should be: location /static { root /var/www/env/application/app; }

Categories : Nginx

For an app hosted on meteor.com, would it be reasonable to use a proxy to add SSL and a custom domain?
For your info, Meteor has a roadmap to roll out Galaxy (managed "meteor deploy" to your own servers) in list Under consideration for 1.1+. And it should be a perfect choice for you. Here is their Trello This is MDG's commercial product -- a managed cloud platform for deploying Meteor apps. You have control of the underlying hardware (you own the servers or the EC2 instances, and Galaxy man

Categories : Nginx

Custom routing in load balancer
In nginx you can do it simply by using if: location / { if ($http_cookie ~* "yourcookiename=a") { proxy_pass http://upstream_a; break; } if ($http_cookie ~* "yourcookiename=b") { proxy_pass http://upstream_b; break; } proxy_pass http://upstream_c; } This is simple regexp , so this way if "yourcookiename" has value a1,a2 etc. it will go to upr

Categories : Nginx

Nginx custom configuration
location /blog/ won't match requests for /blog, but location /blog will. try_files... try files. Thus, if your request contains a trailing slash, nginx will search for a directory (files ending with / are directories only on any filesystem). If you wish nginx to search for a file when a requests contains a trailing slash, you will need to rewrite the request to its pre-trailing-slash form. Note

Categories : Nginx

How to edit nginx.conf to increase file size upload
Add client_max_body_size Now that you are editing the file you need to add the line into the server block, like so; server { client_max_body_size 8M; //other lines... } If you are hosting multiple sites add it to the http context like so; http { client_max_body_size 8M; //other lines... } And also update the upload_max_filesize in your php.ini file so that you can upload f

Categories : Nginx

Nginx location match all file extensions except php
The PCRE Library Nginx uses the PCRE library written in C. There's a huge man page, a bit hard to understand sometimes but quite detailed. Among it, you will find the look ahead / look behind functionnalities as you would find them in Perl. Postive/negative look ahead/behind Positive/negative look ahead/behind allow to match a string if one part of it is/isn't followed/preceded by an expression

Categories : Nginx

How to optimize images from subdomain with ngx_pagespeed
pagespeed LoadFromFile "https://app.domain.com/files" "/var/www/app.termin2go.com/frontend/files"; You're missing a trailing slash from the end of .../frontend/files

Categories : Nginx

Can't launch openresty docker
You parent container 3scale/openresty has the line ONBUILD CMD ["supervisord", "-n"] This means that sypervisord is already running (See here for deails of ONBUILD). When your command of supervisord is run it finds the conflict.

Categories : Nginx

Unable to proxy_pass mailcather with nginx
This works for me: location /mailcatcher { rewrite /mailcatcher/(.*) /$1 break; proxy_pass http://mailcatcher/; } location ~ ^/assets { proxy_pass http://mailcatcher; } location ~ ^/messages { proxy_pass http://mailcatcher; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }

Categories : Nginx




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