Sponsored Content
Top Forums Web Development Apache: Forward Proxy Via Virtualhost Post 302338938 by krunksta on Wednesday 29th of July 2009 10:02:24 AM
Old 07-29-2009
Apache: Forward Proxy Via Virtualhost

I've set up a forward proxy within a VirtualHost (see below) on Apache 2.2.11. I then browse using mydomain.com:80 as the proxy - I've also tried using the IP address of the VirtualHost xxx.xxx.xxx.xxx:80. It works fine, the only problem is that in both cases the server's main IP address is always displayed at the other end. Is there a way to make it so that the individual IP of the VirtualHost is shown instead?

I've tested the proxy via other VirtualHosts on the server and it doesn't work, so I know that it's being properly channelled through this one.

NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80>
   ServerName mydomain.com
   DocumentRoot /xxx/xxx/public_html
   ServerAdmin xxx@xxx.com
   ProxyRequests On
   ProxyVia On
   <Proxy *>
      Order deny,allow
      Allow from xxx.xxx.xxx.xxx


9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Apache httpd.conf <VirtualHost> issue

I have just configured httpd.conf on a new Redhat 9 install. Below are my additions to httpd.conf. Everything works fine except that when typing http://spetnik.d2g.com into my web browser, I am sent to the "Default catch all" site. Any clues? NameVirtualHost *:80 #Default catch all ... (5 Replies)
Discussion started by: Spetnik
5 Replies

2. UNIX for Advanced & Expert Users

squid proxy and apache servers

hi. pardon my noob question id just like to have a quick answer. i am planning to install a jabber webclient and a jabber server in our apache server. my boss said this wouldnt work because squid filters port 5222 connections (jabber). i told him we can simply 'unfilter' the port then but he said... (0 Replies)
Discussion started by: marcpascual
0 Replies

3. UNIX for Advanced & Expert Users

Apache-Reverse proxy and load balancing

Hi All, I have a webpage loaded on server1 with authorization enabled by .htaccess, which can be accessed by http://ipofserver1/index.html. Now im planning a high availabilty load balancing in such a way that if the server1 is down due to some reason it should connect to another server. i have... (1 Reply)
Discussion started by: Tuxidow
1 Replies

4. Web Development

Copy and forward apache http request

Hello, I am using apache 2.2 and I need to have certain http requests (those including example.com for instance) to be executed normally and forwarded to another server. With mod_rewrite, I could easily forward but then the input request would not be executed on my server. Right? Am I... (1 Reply)
Discussion started by: JCR
1 Replies

5. Web Development

Apache virtualhost dinternal domain

Hello, I have have installed two web applications on one server with one IP address and one domain name (mynet.intra). Is it possible to configure in apache 2.2 that access to one application would be from "app1.mynet.intra" and to another application from address "app2.mynet.intra"? Document... (1 Reply)
Discussion started by: kreno
1 Replies

6. Ubuntu

Iptables forward traffic to forward chain!!!

Hi, I am new to linux stuff. I want to use linux iptables to configure rule so that all my incoming traffic with protocol "tcp" is forwarded to the "FORWARD CHAIN". The traffic i am dealing with has destination addresss of my machine but i want to block it from coming to input chain and somehow... (0 Replies)
Discussion started by: arsipk
0 Replies

7. Red Hat

apache httpd virtual hosts setup keep hitting the same VirtualHost

I'm trying to set up two virtual hosts. Here's my httpd config: <Directory /Users/userX/dev/sandbox-2> Order deny,allow deny from All Allow from localhost </Directory> NameVirtualHost <VirtualHost> DocumentRoot "/Users/userX/dev/sandbox-2" ... (0 Replies)
Discussion started by: GlideK
0 Replies

8. Web Development

Apache proxy for web app with ssl

I have a ubuntu server running subsonic as a web app. Currently the web interface is available from port 4040 for https connections and 4141 for https connections with the context /subsonic as follows: http://mydomain:4040/subsonic https://mydomain:4141/subsonic I would like to loose the port... (0 Replies)
Discussion started by: barrydocks
0 Replies

9. Linux

Apache/2.2.25 VirtualHost not working

I am having problems in implementing the virtual hosts here in my server. I have this one cloud dev server: Amazon Linux AMI release 2013.03 (based on RHEL like CentOS) with Apache 2.2.25 installed and I'm trying to create 2 virtual hosts: test-kalc.tk and test2-kalc.tk. If I go to... (2 Replies)
Discussion started by: jpdoria
2 Replies
CURLOPT_PROXY(3)					     curl_easy_setopt options						  CURLOPT_PROXY(3)

CURLOPT_PROXY - set proxy to use SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY, char *proxy); DESCRIPTION
Set the proxy to use for the upcoming request. The parameter should be a char * to a zero terminated string holding the host name or dotted numerical IP address. A numerical IPv6 address must be written within [brackets]. To specify port number in this string, append :[port] to the end of the host name. The proxy's port number may optionally be specified with the separate option CURLOPT_PROXYPORT(3). If not specified, libcurl will default to using port 1080 for proxies. The proxy string may be prefixed with [scheme]:// to specify which kind of proxy is used. http:// HTTP Proxy. Default when no scheme or proxy type is specified. https:// HTTPS Proxy. (Added in 7.52.0 for OpenSSL, GnuTLS and NSS) socks4:// SOCKS4 Proxy. socks4a:// SOCKS4a Proxy. Proxy resolves URL hostname. socks5:// SOCKS5 Proxy. socks5h:// SOCKS5 Proxy. Proxy resolves URL hostname. Without a scheme prefix, CURLOPT_PROXYTYPE(3) can be used to specify which kind of proxy the string identifies. When you tell the library to use a HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as CURLOPT_QUOTE(3) and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with CURLOPT_HTTPPROXYTUNNEL(3). libcurl respects the environment variables http_proxy, ftp_proxy, all_proxy etc, if any of those are set. The CURLOPT_PROXY(3) option does however override any possibly set environment variables. Setting the proxy string to "" (an empty string) will explicitly disable the use of a proxy, even if there is an environment variable set for it. A proxy host string can also include protocol scheme (http://) and embedded user + password. The application does not have to keep the string around after setting this option. DEFAULT
Default is NULL, meaning no proxy is used. When you set a host name to use, do not assume that there's any particular single port number used widely for proxies. Specify it! PROTOCOLS
All except file://. Note that some protocols don't do very well over proxy. EXAMPLE
Since 7.14.1 the proxy environment variable names can include the protocol scheme. Since 7.21.7 the proxy string supports the socks protocols as "schemes". Since 7.50.2, unsupported schemes in proxy strings cause libcurl to return error. RETURN VALUE
Returns CURLE_OK if proxies are supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. SEE ALSO

Featured Tech Videos

All times are GMT -4. The time now is 12:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy