Questions tagged [mod-proxy]
Module for the apache webserver with which apache can be used as proxy server. With this module apache can act as a regular proxy, or as a reverse proxy for upstream servers.
694 questions
15 votes
2 answers
13k views
Apache mod_proxy vs mod_rewrite
What is the difference between using mod_proxy and mod_rewrite? I have a requirement to send certain url patterns through the tomcat, which runs on the same host but under port 8080. I know this is ...
0 votes
2 answers
9k views
How do I configure Apache to proxy Tomcat using AJP?
I have a fresh install of Fedora 23 (Workstation) with fresh installs of Apache 2.4 and Tomcat 8. I'm attempting a very simple setup: A single instance of Apache will proxy all traffic for a single ...
22 votes
2 answers
45k views
What is the use of ProxyPassReverse Directive
Definition from apache.org (ProxyPassDirective) says: This directive lets Apache httpd adjust the URL in the Location, Content-Location and URI headers on HTTP redirect responses. This is essential ...
0 votes
1 answer
658 views
Configure Apache Web Server (shared hosting) to provide simultaneous Web and Websocket Access
I'm trying since some days to find a way to configure simultaneous websocket and web server connections with one same Apache Web Server I have on a shared hosting basis. Now, before giving that up and ...
2 votes
1 answer
7k views
Lighttpd reverse proxy HTTPS to another server on HTTP
I've a Lighttpd server running on HTTPS, and I want to have one subdirectory on the server act as a reverse proxy for a separate server that runs on HTTP. I've tried following guides on doing both ...
0 votes
1 answer
6k views
ReverseProxy Wildcard?
Is it possible to have a wildcard for a reverse Proxy using ProxyPass? I've seen similar config below for ProxypassMatch, so I tried to model it off of that using just proxypass ProxyPass ^/...
6 votes
2 answers
72k views
how to fix apache2 "proxy_http:error" AH01102: error reading status line from remote server localhost:4382
how to fix apache2 "proxy_http:error" AH01102: error reading status line from remote server localhost:4382. I have an apache2 webserver which is being used to serve few nodejs applications in the ...
0 votes
0 answers
39 views
Pass mod_proxy parameters when using SetHandler for php-fpm
I've configured Apache to serve PHP via php-fpm through a unix socket with the SetHandler directive: <FilesMatch ".+\.php$"> SetHandler "proxy:unix:/run/php/php-fpm.sock|fcgi:/...
1 vote
1 answer
2k views
Apache reverse proxy to site using NTLM authentication fails with mod_rewrite but not mod_proxy
We have a reverse proxy server in front of an Exchange server and would like to lock down more of the paths. Minimized examples: Fails (but works for all pages that don't require authentication): <...
2 votes
1 answer
197 views
Serve static files and proxy if not found
I'm trying to configure a vhost to work with a proxy, but only if the request is not for a static file -- in which case I'd like Apache to serve it. Here's what I'm using: <VirtualHost *:80> ...
1 vote
0 answers
39 views
Apache: ProxyPass not working if request was already ProxyPassed by previous server
on our intranet I have two servers in two different areas. Server 1 is providing a lab environment via ShellInABox web service. ShellInABox opens local ports to which Apache can connect via proxy ...
2 votes
2 answers
4k views
Apache 2.4: mod_alias, mod_rewrite, mod_proxy execution order
I can't find any documentation on Apache vhosts instructions priority / execution order between mod_alias (Redirect instructions), mod_rewrite (RewriteRule instructions) mod_proxy (ProxyPass ...
1 vote
0 answers
116 views
Apache httpd forward proxy - remove Proxy-agent header from CONNECT requests
Is there any way to remove Proxy-agent header (set to Apache/2.4.6.2(OS)) from CONNECT requests going through Apache httpd configured as forward proxy (forwarding requests to another uplink proxy)? &...
0 votes
3 answers
8k views
504 Gateway timeout cause 70007 on Apache 2.4 + mod_proxy Ubuntu 18.04
I am tired of so many tries to fix 504 Gateway timeout from mod_proxy in Apache 2.4 using PHP-FPM. So i try to find a solution here. Actual i plan to migrate a Software from an old Apache Server to a ...
1 vote
2 answers
1k views
mod_proxy map http://myserver/game to http://localhost:5732/?
N00b question. I have an URL http://myserver.com/game and would like to call an internal resource http://localhost:5732/ I tried: AllowCONNECT 5732 ProxyPass /game/ http://localhost:5732/ nocanon ...
0 votes
0 answers
34 views
ProxyPass response translate http to https [duplicate]
We have an external Apache server that proxies a https url to an internal http site <VirtualHost *:443> ServerName external.domain ServerAlias www.external.domain ProxyRequests Off ...
0 votes
3 answers
5k views
Tomcat logging and mod_proxy
I have Tomcat running on port 8080, and when I send a request directly to Tomcat it works fine: curl -IL http://localhost:8080/myapp HTTP/1.1 302 Moved Temporarily Server: Apache-Coyote/1.1 Location:...
0 votes
1 answer
118 views
Apache config to proxy entire site with 1 exception
I have a website www.example.com on a hosting provider. We use that provider because it has a simple site builder my wife uses to maintain the site. Moving off of it isn't an option for this ...
1 vote
1 answer
82 views
ProxyPassMatch backreference issues
I am attempting to take all requests matching the regex ^/(map/maps/[^/]*/live/.*) redirect into a local server http://127.0.0.1:8100/. However, the path that needs to be passed to the backreference ...
28 votes
6 answers
122k views
How can I enable logging for requests going through mod proxy
Is there a way to log requests going through mod proxy? I need a way to debug my configuration, because I don't seem to be getting where I should be. I need the following information: headers of ...
5 votes
2 answers
5k views
ERR_INCOMPLETE_CHUNKED_ENCODING when using AddOutputFilterByType in Apache reverse proxy
I'm trying to set up a Shopware site using Docker behind a Apache2 reverse proxy. Since the Shopware software for some reason puts its backend host "http://127.0.0.1:18084" into the JavaScript it ...
0 votes
0 answers
116 views
Apache custom rewrite rule, using code
I would like to have Apache handle some custom URL rewrite code that I have. This code rewrites the following urls: https://www.example.com/request?data=SOMEDATABLOB into urls pointing to PHP pages. ...
0 votes
1 answer
91 views
Virtual Host SSL and nonSSL with Proxy
I have 1 nonSSL server and many SSL with Proxy in Apache. Configuration SSL server: <VirtualHost *:443> ServerName test.com ServerAdmin [email protected] ErrorLog ${...
0 votes
0 answers
673 views
Set up proxy for Nextjs and WordPress blog
Thanks in advance. I am new to server setup. So pardon me If I used the wrong words. I am setting up an Ubuntu server to host Nextjs and WordPress blog on the same server. I have to set up Nextjs on ...
10 votes
1 answer
61k views
How to pass a request from one apache server to another
I have two Apache Servers with mod_proxy enabled. I want to know how to "pass the request" from "Apache Server A" to "Apache Server B" using the same port (80). In server ...
3 votes
1 answer
7k views
Use of ProxyPassReverse to change Location response header
I am implementing a reverse http proxy: proxy.example.com This will forward requests to servers based on URI: proxy.example.com/server1 -> server1.example.com When a user requests proxy.example....
0 votes
1 answer
906 views
mod_proxy_hcheck causes apache-2.4 startup-crash
I would like to create a load-balanced environment using Apache 2.4.43 (windows) and two Tomcats servers. Using the "mod_proxy_hcheck" module some basic healthcheck operations should be ...
2 votes
1 answer
602 views
How to change HTTP-status based on origin's header?
I'm dealing with a proprietary HTTP-server, which always responds with code 200 -- even when an error occurred. The indication of an error, if any, can only be found in the custom header, for example: ...
0 votes
2 answers
182 views
Apache virtualhosts conf let wrong servername requests going through proxy
I have moved a server configuration to a new server and at the same time configured it with apache mod_proxy to access a gunicorn/django webserver (inside a docker container on port 8000). Previous ...
0 votes
1 answer
551 views
Apache module proxy_html not working
I have a Joomla 4 site running in a Ubuntu 22.04 server (hostname = web-02). The Internet facing web server running in a Ubuntu 20.04 server (hostname = web-01) has configured as a reverse proxy for ...
0 votes
1 answer
76 views
Apache - ProxyPass serve port only for one server name
I have a react app that listening to localhost:3939 Then, I configured a Virtualhost like this to proxy pass the port 3939 on https://test.example.com: <IfModule mod_ssl.c> <VirtualHost *:443&...
0 votes
1 answer
390 views
Change the script path in an Apache proxy handler
I'm developing my application with 2 containers: apache and php-fpm. Apache serves requests, and delegates PHP execution to the php-fpm container in its vhost: <FilesMatch .php$> ...
0 votes
2 answers
993 views
apache mod_proxy URL redirect/alias
Guys! Having a problem with apache mod_proxy, hoping someone can help Preface: We need a new domain (http://section1.info) to direct users to (http://domain.info/?q=section1) and maintain section1....
4 votes
6 answers
39k views
How can I fix recurring PHP 503 Errors on my Apache-mod_proxy_fcgi-PHP-FPM Server?
i'm having trouble with my php-fpm setup. Maybe you guys can point me in the right direction. First off, everything is working fine. But every now and then, I'll get 503 Errors. Those errors are gone ...
0 votes
1 answer
89 views
mod_proxy + mod_reqrite results in errors 502 or 502
I have working httpd config (reverse proxy) that forwards requests to proxy: Listen 443 https <VirtualHost *:443> ServerName public-dns.example.org ServerAlias internal-hostname....
9 votes
3 answers
17k views
Apache mod_proxy: forward secure websocket to non-secure
The websocket library I rely on (PHP-Websockets) does not yet support secure sockets (wss). My website is served over https though, so I cannot use insecure ws connections. I'm trying to use Apache's ...
1 vote
1 answer
2k views
How to configure a system wide proxy for php file_get_contents on CentOS?
I want to let the php file_get_content function connect to network via system-wide proxy. I tried to add the following lines in /etc/environment: http_proxy=http://localhost:3128/ HTTP_PROXY=http://...
2 votes
1 answer
2k views
how to increase Apache mod_proxy Jetty 5minute timeout
we use Apache and Jetty to do install components behind a firewall. Some actions take a while ( 10-15 minutes ). Apache is the proxy and Jetty is the proxy target on some machines. Everything works ...
1 vote
2 answers
2k views
mod_proxy failing as forward proxy in simple configuration
(On Mac OS X 10.6, Apache 2.2.11) Following the oft-repeated googled advice, I've set up mod_proxy on my Mac to act as a forward proxy for http requests. My httpd.conf contains this: <IfModule ...
1 vote
1 answer
2k views
Lighttpd and Discourse (Docker): configuring mod_proxy
I have trouble configuring Lighttpd to serve the various services hosted on my server. Lighttpd acts as a front, and I have several DNS records, each for a different subdomain, redirecting to the same ...
0 votes
0 answers
262 views
apache proxy an URI to a backend server
I want to proxy one URI of my domain to a specific backend server. I have a public domain name external.lan and a private one lets say internal.lan. I want http://external.lan/gogs be served by ...
0 votes
1 answer
2k views
Apache as a HTTP proxy and filter
I am interested if Apache's mod_proxy can be configured to filter the content sent through it. For example, if a user makes a request to site A then send request X to the server otherwise send an ...
0 votes
1 answer
2k views
apache mod proxy_wstunnel invalid utf8 during websocket upgrade
I am experiencing an intermittent problem when connecting the jetty web-socket client to the server. The good people at Jetty assure me it is not a problem with Jetty. On the server side I have ...
1 vote
1 answer
2k views
Apache mod_proxy_html Substitute: how to re-use part of regex match? (regex variables?)
Have a unique URL-rewriting situation in Apache. I need to be able to take a URL that starts with "\u002f[X]" or '\u002f[X]" Where X is the rest of some URL, and substitute the text "\...
0 votes
1 answer
2k views
ProxyPassMatch, regex to proxy dynamic content
I have a shared hosting server with some 2000 websites on it. I have a lightweight apache/event frontend that takes care of static content and locally proxies requests for dynamic content to a ...
1 vote
2 answers
2k views
How to create a reverse proxy to host specified in url?
I need to configure proxy with apache to proxy requests like http://example.com/proxy/www.anothersite.com/[some-params] to http://www.anothersite.com/[some-params] I tried to do this like that: <...
0 votes
1 answer
1k views
httpd: Connection attempts using mod_proxy:
On my debian 11 based mailserver I noticed some entries in my daily logs: --------------------- httpd Begin ------------------------ Connection attempts using mod_proxy: 161.35.188.242 -> leakix....
0 votes
1 answer
3k views
ProxyPass changes 304 status to 200 and adds content-type
The probelm I am running a node server (sqlpad) through an Apache2 reverse proxy. On some requests, the node server returns a 304 status code with no Content-Type when accessed directly. However, ...
0 votes
1 answer
3k views
Apache HTTPD rewrite backend proxy HTTP error 500 to 503
I have two use cases: HTTPD is a proxy for a Tomcat application HTTPD is a proxy for a PHP application For compliance and security needs all 50x errors must be rewritten to 503 prior to sending back ...
2 votes
1 answer
3k views
Apache 2.2: RewriteMap, ProxyPass interpolation and Keep-Alive
I have an Apache httpd used as a SSL reverse proxy frontend for a lot of backends. I compute the name of the backend from the path given by the user. e.g: https://myhostname.com/myaccount translates ...