I have a scenario  location / {  # If the request_uri is /a/b/c  # then proxy_pass http://upstream/c  }   Please help me out with any suggestions. I saw this  , but the solution doesn't work for me.
121104
In Nginx we have been trying to redirect a URL as follows:  http://example.com/some/path -&gt; http://192.168.1.24   where the user still sees the original URL in their browser. Once the user is redirected, say they click on the link to /section/index.html, we would want this to make a request that leads to the redirect  http://example.com/some/path/section/index.html -&gt; http://192.168.1.24/section/index.html   and again still preserve the original URL.  Our attempts have involved various solutions using proxies and rewrite rules, and below shows the configuration that has brought us closest to a solution (note that this is the web server configuration for the example.com web server). However, there are still two problems with this:   It does not perform the rewrite properly, in that the request URL received by the web server http://192.168.1.24 includes /some/path and therefore fails to serve the required page. When you hover on a link once a page has been served, /some/path is missing from the URL  server {     listen          80;     server_name     www.example.com;      location /some/path/ {         proxy_pass http://192.168.1.24;         proxy_redirect http://www.example.com/some/path http://192.168.1.24;         proxy_set_header Host $host;     }      location / {         index index.html;         root  /var/www/example.com/htdocs;     } }    We are looking for a solution that only involves changing the web server configuration on example.com. We are able to change the config on 192.168.1.24 (also Nginx), however we want to try and avoid this because we will need to repeat this setup for hundreds of different servers whose access is proxied through example.com.
53840
I have the following in my httpd.conf file  NameVirtualHost *:80  &lt;IfModule mod_vhost_alias.c&gt;   &lt;VirtualHost *:80&gt;     ServerAlias *     UseCanonicalName Off     LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon     CustomLog /var/log/httpd/access_log vcommon     VirtualDocumentRoot /web-data/vhosts/%0/httpdocs     VirtualScriptAlias  /web-data/vhosts/%0/httpdocs   &lt;/VirtualHost&gt; &lt;/IfModule&gt;   This works great for dynamic hosting. However, I can't figure out how to make https requests work the same way. What do I need to add to this so that https and http for the same domain request get sent to the same folder?
18156
I live in Ethiopia and the government blocks all urls with the word "proxy" in them. I couldn't use that word in the title above because that would make the url contain the word proxy.   When I apt-get upgrade I get errors because some packages like libproxy1, libproxy1-plugin-gsettings, libproxy1-plugin-networkmanager, python-libproxy all contain the p word.  Therefore, it is all blocked. I tried putting the urls into proxy sites, but they all just returned to their home page.   Are there any other solutions?
122890
Can anyone help me configure Transmission to download torrent files behind a proxy?  I have http_proxy set in my .bashrc.
6945
When looking at my Apache2 access logs, I occasionally see GET requests asking my server for a page on a completely different server. For example:  xx.xx.xx.xx - - [18/Jan/2012:07:12:10 -0500] "GET http://someotherserver.com/?sometimesmorestuff=likethis HTTP/1.1" 200 389 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"   I remembered reading something about that in the past, but at the time I had never seen that on my server, so I didn't worry about it.   Now that I am seeing it on my server, I just ran a test and it appears that my site does indeed serve requests for content from other servers. This seems like a bad thing. So, two questions:  A) Is this something I should be worrying about?  B) How can I fix it?  I've tried a little Googling, but I don't even know what this sort of thing is called, and that makes it difficult.
30732
What is the difference between these two URLs:   http://example.com/ http://example.com   Should we always add the final / or avoid it? Does it make a difference?
41529
I am trying to make my nginx redirects as clean as possible.  I understand ~* is for case insensitive but I can only get it to work in example 2.    Example 1  rewrite ^/foobar http://www.youtube.com/watch?v=oHg5SJYRHA0 redirect;   Example 2 -This works, but it isn't as efficient as the line above.     if ( $request_filename ~* foobar ) {          rewrite ^ http://www.youtube.com/watch?v=oHg5SJYRHA0 redirect;    }   Is there a way to do case insensitive redirects with example 1 without getting it too muddy?  Thanks.
68341
I need to be able to get at the full URL of the page I am on from a user control.  Is it just a matter of concatenating a bunch of Request variables together?  If so which ones? Or is there a more simpiler way?
41631
I am using Apache2 as a reverse proxy for tomcat, my configuration being something like:  ProxyRequests Off  ProxyPass        / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/   My question is: can I configure Apache to show up a courtesy page (an "under construction" HTML static page) whenever Tomcat is down?
22275
How do I change proxy settings from command line in Windows&nbsp;7?  I'm not talking about just the http_proxy. I need to set system-wide proxy settings (the ones in Internet properties setting). How do I do that?
83779
Ok, so I have an index.php file which has to process many different file types.  how do I guess the filetype based on the REQUEST_URI.  If I request http://site/image.jpg, and all requests redirect through index.php, which looks like this  &lt;?php    include('/www/site'.$_SERVER['REQUEST_URI']); ?&gt;   How would I make that work correctly?  Should I test based on the extension of the file requested, or is there a way to get the filetype?
92297
So I am running Ubuntu Studio on my laptop and what do I do to connect to a proxy? I search for proxy and in network settings their is no PROXY tab. What are key words in the tabs to look for?
24719
I'm trying to follow the  (on my Ubuntu 10.04 VM).  The first step is:  sudo add-apt-repository ppa:linaro-maintainers/toolchain   But when I run that I get:  Error reading https://launchpad.net/api/1.0/~linaro-maintainers/+archive/toolchain: &lt;urlopen error [Errno 110] Connection timed out&gt;   I'm guessing the problem is with my configuration for my employer's proxy server, particularly for HTTPS.  When I opened  in Firefox, I got "The connection has timed out".  I then went into Firefox Preferences -> Advanced -> Network -> Settings... and set HTTP Proxy to "gateway" and Port to 8080, and checked "Use this proxy server for all protocols".  Then the page loaded.  This supports my theory.  I've tried setting the http_proxy and https_proxy environment variables (both lower and upper case):  $ set | grep -i proxy HTTPS_PROXY=https://gateway:8080 HTTP_PROXY=http://gateway:8080 http_proxy=http://gateway:8080 https_proxy=https://gateway:8080   I also tried changing them to:  $ set | grep -i proxy HTTPS_PROXY=gateway:8080 HTTP_PROXY=gateway:8080 http_proxy=gateway:8080 https_proxy=gateway:8080   And I tried adding this second line to /etc/apt/apt.conf:  Acquire::http::proxy "http://gateway:8080/"; Acquire::https::proxy "https://gateway:8080/";   But I continue to get the same error.  How do I troubleshoot this?  Update: I followed the instructions in the  to  and got further:  $ sudo add-apt-repository ppa:linaro-maintainers/toolchain Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 1DD749B890A6F66D050D985CF1FCBACA7BE1F97B gpg: requesting key 7BE1F97B from hkp server keyserver.ubuntu.com gpgkeys: HTTP fetch error 7: couldn't connect to host gpg: no valid OpenPGP data found. gpg: Total number processed: 0   I wonder if the "HTTP fetch error" means I also need to add "Defaults env_keep = http_proxy" to /etc/sudoers...  Update #2: I added:  Defaults env_keep="http_proxy" Defaults env_keep="https_proxy"   ...as in , but I still get the same "gpgkeys: HTTP fetch error 7: couldn't connect to host" error.  And this is curious:  $ sudo env | grep proxy https_proxy=https://gateway:8080   ...because http_proxy isn't there.  Any advice is appreciated.  Update #3: Since the host of my VM is a laptop, I took it home and tried there (with no proxies):  $ sudo add-apt-repository ppa:linaro-maintainers/toolchain Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 1DD749B890A6F66D050D985CF1FCBACA7BE1F97B gpg: requesting key 7BE1F97B from hkp server keyserver.ubuntu.com gpg: key 7BE1F97B: public key "Launchpad Linaro Overlay PPA" imported gpg: Total number processed: 1 gpg:               imported: 1  (RSA: 1)   It worked.  So problem is related to proxy configuration.  But I suppose I have a workaround.
25901
My environment has user requests passing through a number of systems:  [Client] --> [ELB] ---> [nginx] --> [web]  (ELB = AWS Elastic Load Balancer)  Thanks to this , I have nginx determining and passing the correct client IP address to the upstream servers (web) with the X-Forwarded-For and X-Real_IP headers. The relevant nginx config:      real_ip_header      X-Forwarded-For;     set_real_ip_from        10.0.0.0/8;     real_ip_recursive   on;     proxy_set_header X-Real-IP $remote_addr;   My problem is this, the Real IP module in nginx replaces the existing $remote_addr variable with the result of its X-Forwarded-For calculations. This gives me the originating client IP, but I'm losing the IP address of the system that actually sent the request to the proxy (i.e. the ELB).  Overall, having the client IP is more important to me, but I would like to be able to log the full chain of requests so I can understand (and debug) how traffic is flowing. Currently, I can only have nginx log the client IP, its own IP, and the upstream server IP. I would like to be able to log the ELB IP as well.  I see  asked the same  in 2013, with little luck. Has anything changed or improved since then?
5141
Somehow, and I'm not sure how, we have configured an nginx reverse proxy that is acting as an open proxy.  The log files tells us the matching requests are going against the following conf file:  map $http_upgrade $connection_upgrade {         default upgrade;         ''      close; }  access_log      /var/log/nginx/access.p.log; error_log       /var/log/nginx/error.p.log;  proxy_next_upstream     error timeout invalid_header http_500 http_502 http_503 http_504; proxy_buffers           8 32k; proxy_buffer_size       64k; proxy_http_version      1.1; 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_redirect          off; proxy_set_header        Upgrade         $http_upgrade; proxy_set_header        Connection      $connection_upgrade;  server {         listen          80;         server_name     ~first.*\.second\.com;          location / {                 resolver                172.16.1.1 172.16.1.2;                 proxy_pass              http://$host;                 proxy_read_timeout      7200s;         } }  server {         listen          443;         server_name     ~first.*\.second\.com;         ssl             on;          location / {                 resolver                172.16.1.1 172.16.1.2;                 proxy_pass              https://$host;                 proxy_read_timeout      7200s;         } }   The top-level conf file looks like this:  user nginx; worker_processes 8; pid /var/run/nginx.pid;  events {         worker_connections 4096;         # multi_accept on; }  http {      ##     # Basic Settings     ##      sendfile on;     tcp_nopush on;     tcp_nodelay on;     keepalive_timeout 65;     types_hash_max_size 2048;     # server_tokens off;      # server_names_hash_bucket_size 64;     # server_name_in_redirect off;      include /etc/nginx/mime.types;     default_type application/octet-stream;      ##     # Logging Settings     ##      access_log /var/log/nginx/access.log;     error_log /var/log/nginx/error.log;      ##     # Gzip Settings     ##      gzip on;     gzip_disable "msie6";      # gzip_vary on;     # gzip_proxied any;     # gzip_comp_level 6;     # gzip_buffers 16 8k;     # gzip_http_version 1.1;     # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;      ##     # nginx-naxsi config     ##     # Uncomment it if you installed nginx-naxsi     ##      #include /etc/nginx/naxsi_core.rules;      ##     # nginx-passenger config     ##     # Uncomment it if you installed nginx-passenger     ##      #passenger_root /usr;     #passenger_ruby /usr/bin/ruby;      ##      include /etc/nginx/conf.d/*.conf;     #include /etc/nginx/sites-enabled/*;   }  what here is causing this?
20958
I am using nginx/0.7.68, running on CentOS, with the following configuration:  server {     listen       80;     server_name ***;     index index.html index.htm index.php default.html default.htm default.php;      location / {             root   /***;             proxy_pass   http://***:8888;             index  index.html index.htm;     }     # where *** is my variables   The proxy_pass is to a DNS record whose IP changes frequently. Nginx caches the outdated IP address, resulting in a request to the wrong IP address.  How can I stop nginx from caching the IP address, when it is outdated?
8413
When exactly do I need to use a proxy with openlayers? I've done a lot of reading on this but can't seem to find a definitive answer. Wondering if this is the route of my problems.  For instance, if I have one server running Geoserver (WFS) on port 8080 and Apache (serving OpenLayers) on port 80 would I need to use a proxy?  If the servers are physically separate would I need to use proxy?