Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
80 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. ...
andynewman's user avatar
2 votes
1 answer
365 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: ...
Mikhail T.'s user avatar
  • 2,441
0 votes
1 answer
71 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....
tomas's user avatar
  • 133
3 votes
1 answer
363 views

Apache2 mod rewrite extremely slow, on one server only

I have a site on my local ubuntu dev box with some mod rewrite rules, which we are attempting to use to force google and other bots to index the correct page, rather than our ajax snippets as they ...
sgc's user avatar
  • 41
0 votes
0 answers
329 views

reverse proxy Apache that redirects filtering by ip and path

I am trying to create a reverse proxy with apache that if it receives a request with /thisismypath as path and the ip address that make that request is 192.168.2.12 the it should redirect to 192.168.1....
P00's user avatar
  • 1
1 vote
0 answers
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): <...
melds's user avatar
  • 231
1 vote
1 answer
3k views

Apache 500 Error when proxying api subdirectory

I am trying to redirect PUT request for a specific endpoint to another host. The said endpoint resides under /internal and accepts only PUT requests. The other endpoints under /internal will continue ...
argyrodagdileli's user avatar
1 vote
0 answers
846 views

Apache Reverse Proxy rewrite rule for complex URL. "Too Many Redirects" error

I am trying to configure a reverse proxy to my backend server. This is my previous configuration which is working. Define REMOTE_ADDR proxyserver.domain.com <VirtualHost *:443> ...
Renegade's user avatar
0 votes
1 answer
192 views

Apache2 Virtual Host Proxy Forward

Hi all I am trying to use a virtual host to forward streaming.fusion.tk to my internal emby server form my webserver. I have setup a config file called streaming.conf in /etc/apache2/sites-available/ &...
Fusion's user avatar
  • 11
1 vote
1 answer
5k views

Apache ProxyPass + RewriteRule?

I've set up an apache config to try to redirect /login and to ProxyPass all other requests: RewriteEngine on RewriteCond "%{REQUEST_URI}" "^/login$" RewriteRule "^/login$"...
Jellicle's user avatar
  • 324
2 votes
1 answer
508 views

Apache rewrite proxy only homepage

I've tried various regular expressions (^/$, ^index.php$, ^$) to rewrite/proxy just the homepage of a WordPress website through .htaccess. For the record I have the appropriate modules loaded to ...
user1791914's user avatar
1 vote
1 answer
1k views

Apache: Dynamic Reverse Proxy

is it possible to have an Apache server dynamically proxy all requests defined by a subdir? Like: https://proxy.example.com/host1 -> https://host1.example.com https://proxy.example.com/...
Zitronenhai's user avatar
1 vote
0 answers
640 views

Apache mod_rewrite P flag is rewriting URL unexpectedly

I've recently received a request from the site owner to redirect our base domain to a specific landing page on a subdomain, which is working just fine. The problem is that he wants the URL to remain ...
Justin Folvarcik's user avatar
1 vote
0 answers
138 views

Apache graceful stop waiting for rewrite requests

I am using Apache as a reverse proxy, and mod_rewrite to pass on the requests to backend services for handling. I want to use Apache graceful stop, to allow in-flight requests to complete, however, it ...
rhinds's user avatar
  • 111
0 votes
0 answers
59 views

Rewrite with [P] flag lands in wrong vhost

I have a an old and a new site with 2 different urls, I'm trying to redirect the old urls to the new one with the proxy [p] flag. It works as expected, but it's landing in the wrong virtual host ...
NthDegree's user avatar
  • 101
1 vote
0 answers
2k views

How can I configure a reverseproxy (at /) and a Laravel project (at /backoffice/) running in the same subdomain?

I'm trying to configure on Apache a subdomain that should: Serve a PHP Laravel app if the request starts with /backoffice ReverseProxy to a node app otherwise. I can configure the reverse proxy and ...
My Quid Pro Quo's user avatar
0 votes
0 answers
377 views

Apache forward proxy with mod_rewrite

The Story: I've to (forward) proxy a request - whith certificate checking - to a site which has more than 96 character long URL. The Apache mod_proxy implementation doesn't work URLs that longer 96 ...
user579214's user avatar
5 votes
2 answers
5k views

Apache2 mod_substitute not working in <Location>

I have a working Reverse Proxy that is active only on a specific Location in my site, in this case for example: www.example.com/reverseproxy/site1 I am reverse proxying site1. I want to replace some ...
Paul_Rent's user avatar
2 votes
1 answer
298 views

Does Apache reverse-proxy pipeline requests to origin servers?

When configuring Apache as a reverse proxy (i.e. using ProxyPass or RewriteRule [P]), does it ever pipeline the requests to origin servers, or are they always sent non-pipelined? This is important to ...
Simon Pickup's user avatar
0 votes
1 answer
186 views

Using Apache2 mod_proxy to different server while keeping .htaccess rules somehow working

I am trying to move a part of my website to an external server. I want this part to be accessible through a subdomain, while still being able to apply RewriteRules (doesn't matter whether thats done ...
VampireSilence's user avatar
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 ...
Phil's user avatar
  • 71
1 vote
2 answers
1k views

apache reverse proxy with rewrite mod

I am configuring a new virtual host on my apache reverse proxy with rewrite mod, when testing the configuration all working fine but only one page (image page) is not working. when clicking on image ...
caghiles3's user avatar
2 votes
1 answer
3k 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 ...
Quentin S.'s user avatar
2 votes
2 answers
11k views

Authorization based on custom Header (Apache)

I have a service running behind a Apache Reverse-Proxy that uses the custom headers "username" and "role" to identify users and their role. I want Apache HTTPD to restrict access to to people whose ...
juo's user avatar
  • 33
1 vote
2 answers
536 views

apache mod_rewrite / mod_proxy adds port 443 to proxy url on https to http

We are using mod_rewrite with mod_proxy to proxy requests by crawlers and bots to prerender.io. The prerender service does not support https currently, but my clients site only does, so the proxy is ...
Richard Naeve's user avatar
0 votes
1 answer
113 views

Redirection, subtitute or rewrite

we have a homepage hosted by another provider in amazon, we are developing and event related page, due a SEO needs we need a redirection from http://www.example.com/event (hosted on amazon, out of our ...
Luis Carrillo's user avatar
1 vote
0 answers
835 views

Apache SSL reverse proxy to a node server using websockets

Browsing to a root domain like https://sub.example.com and navigating through pages such as https://sub.example.com/page1 works. But only if I start my initial connection at the root. If I refresh ...
Steve Day's user avatar
1 vote
2 answers
7k views

Apache2 URL Rewrite with Reverse Proxy

I've been trying to accomplish a goal of using Apache as a reverse proxy to translate HTTP to HTTPS as well as using mod_rewrite to inject a query string. The reverse proxy works if tested without ...
Suterusu's user avatar
2 votes
1 answer
1k views

Best way to add authentication layer to static file requests?

I am trying to figure out the best way to add an authentication check to requests for static assets on my server. I am running Apache2.4 and PHP/Laravel, which runs by serving static content ...
Neurax's user avatar
  • 123
0 votes
2 answers
59 views

apache2 reverse proxy, rewrite issue

I keep telling myself this should be simple. Background: I had a site set up (https://example.com) using Let's Encrypt for the SSL setup. Works great. I added a new server to the internal network with ...
Joel Carnes's user avatar
0 votes
1 answer
97 views

apache2 reverse proxy configuration

I have one application that listens on TCP 127.0.0.1:81. I want to accomplish the following redirection: www.example.com/?requestid=123456 --> http://127.0.0.1:81/?requestid=123456 www.example....
creed's user avatar
  • 1
1 vote
0 answers
456 views

Apache mod_rewrite and mod_proxy conflict

I am using Apache, mod_proxy and mod_rewrite I wish for the following: https://www.example.com.*?secure=true to return a 403 https://www.example.com.* to proxy to https://www.example.org I have ...
Alan's user avatar
  • 189
0 votes
1 answer
38 views

Trying to determine between rewrite, redirect or proxy for an Apache Application server

I am running an Apache web application server internally, at App.domain.com. It is exposed externally by using port forwarding at the firewall/gateway as app.domain.com:10080. Access generally works ...
Gerry G.'s user avatar
2 votes
1 answer
387 views

Apache RewriteRule on VirtualHosts doesn't work with group capture regex

I need to create a RewriteRule to delegate an URL path like /tdg/image.jpg?mode=crop&width=300&height=300 to a local proxy. The proxy needs the given URL be transformed into the following ...
Jonas Porto's user avatar
1 vote
1 answer
1k views

Apache decoding semicolon - mod_proxy

Apache, receiving a request with an encoded semicolon (%3B) is decoding it before passing the request to a proxy (backend of Spring Tomcat). Relevant apache Virtual host lines are: ProxyPreserveHost ...
Baker's user avatar
  • 163
3 votes
0 answers
814 views

Apache2 RequestHeader read value as ISO-8859-1 instead of UTF-8

It's a special case, I use an Apache mod_proxy in front of my tomcat and the Apache also add RequestHeader with mod_headers, thanks to mod_rewrite. If special characters are in the URI, they are "read"...
Nicolas Albert's user avatar
-1 votes
2 answers
3k views

Running Jenkins with apache at /jenkins

I need to have access at the /jenkins path to the Jenkins server. This is what I have now in my apache configuration: ProxyPass /jenkins http://localhost:8080 ProxyPassReverse /jenkins http://...
DrKaoliN's user avatar
  • 109
1 vote
1 answer
28 views

How to structure a web-facing server with high bandwidth requirements?

I am designing a service for a web-based scientific computing platform which involves uploading large data files (many GBs). Each file also contains cookies in the header that allows my server to ...
user3335011's user avatar
3 votes
0 answers
522 views

RewriteRule pointing domain resolved as 127.0.0.1

I'm trying to setup proxy in apache like so: <VirtualHost *:80> ServerName test.public.domain ... RewriteRule "^/dir/(.*)" "http://x-service.local/$1" [P,L] ... there is also another ...
a_z's user avatar
  • 41
2 votes
0 answers
819 views

Apache proxy - split SSL_CLIENT_S_DN_CN value and set header

I have configured on Apache proxy mutual SSL with SSLVerifyClient require SSLVerifyDepth 3 The configuration and communication is working like expected. Now I would like to send from Apache proxy ...
user1563721's user avatar
1 vote
1 answer
997 views

Apache rewrite relative URL to application

I have web application running on localhost and listening on port 5050. I would like to have this web application under URL with relative path domain.tld/page/app I tried to use mod_rewrite: <...
Furiia's user avatar
  • 11
1 vote
1 answer
644 views

Rewrite internally from one URL (some path) to another URL (another path)

Is it possible to rewrite/proxy a URL to another URL having different paths ? It should not be just a redirect, and should be a internal proxying to the other URL, so that the browser address bar ...
Anurag's user avatar
  • 11
3 votes
0 answers
364 views

Apache + mod_auth_tkt + mod_rewrite + mod_proxy from root directory

I have a web application running on a tomcat server which is "behind" an Apache httpd server and I am using mod_proxy to forward requests from the httpd to the tomcat server. The httpd server is using ...
Matjaž's user avatar
  • 31
0 votes
1 answer
56 views

Apache and URL rewriting to different names

First off I am running on windows for my sins. I have two tomcat instances of the same web application running on two different ports & I can access both OK directly http://localhost:7070/foo/...
Bill Comer's user avatar
0 votes
1 answer
1k views

mod_rewrite to serve static file based on specific query string with mod_proxy

I would like to have a reverse proxy (apache httpd with mod_proxy) in front of an IIS hosting a SOAP Web Service. The problem I'm facing is that the SOAP clients ask the web server for the details ...
MattBianco's user avatar
1 vote
0 answers
2k views

Decode URL Query String using Mod Rewrite / Regex

I have the following encoded URL https://example.com/external-image?url=http%3A%2F%2Fwww.thirdpartydomain.com%2FTWM%2FImages%2F1264%2F143242%2FFull%2F2201625016119496.jpg I'm using mod rewrite to ...
codejunkie's user avatar
3 votes
2 answers
27k views

Dynamically set RequestHeader host within Apache mod rewrite

I'm using Apache mod_rewrite and I'm looking to dynamically set the Host header with RequestHeader based on the domain from the QUERY_STRING. How would I dynamically set the Host? Given the following ...
codejunkie's user avatar
0 votes
1 answer
3k views

Rewrite user and password in proxied requests

I need to rewrite the client authentication scheme in requests going through an Apache 2.4 reverse proxy. Specifically, I want to ignore the provided username and password, and force the same username ...
Nicolas Melay's user avatar
2 votes
1 answer
745 views

Apache 2.2 proxy reverse and rewrite

I'm facing an issue when trying to configure apache 2.2 as a proxy reverse. I've an application running at my backend server http://internal.mydomain.com/App1/, for now this URL is going to be the $...
Gustavo G E's user avatar
1 vote
2 answers
12k views

to set RequestHeader in apache httpd server is not working

I have a requirement, where I need to set the RequestHeader with a value retrieved from the querystring of the URI. Approach adopted is to write the RewriteCond and ReWriteRule where the condition ...
Usman Azhar's user avatar