Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting up Wildcard subdomain (with reverse proxy) on apache 2.2.3
    primarykey
    data
    text
    <p>What I am trying to achieve is the following: I want to have numerous subdomains such as <b>abc.domain.com</b> redirect to a url such as <b>www.domain.com/something?subdomain=abc</b> </p> <p>Since I am redirecting to a fully qualified domain, I needed to use a reverse proxy to avoid the change of the URL in the browser. (using the [P] Flag and turning on the mod_proxy module and some other modules)</p> <p><i>This is my DNS setup</i></p> <pre><code>*.domain.com. 14400 A 111.111.11.1 </code></pre> <p><i>This is my virtual host configuration for apache</i></p> <pre><code>&lt;VirtualHost 111.111.11.1:80&gt; ServerName www.domain.com ServerAlias *.lionite.com DocumentRoot /var/www/html ErrorLog /var/www/logs UseCanonicalName off RewriteEngine on RewriteCond %{REQUEST_URI} !^/images RewriteCond %{HTTP_HOST} !^www\.domain\.com$ RewriteRule ^(.+) %{HTTP_HOST}$1 [C] RewriteRule ^([^.]+)\.domain\.com(.*) http://www.domain.com/something?subdomain=$1 [P,L] </code></pre> <p></p> <p>This setup is working fine (Let me know if you think you can improve it of course).</p> <p>My main problem is when I am trying to setup https:// </p> <p><i>This is my virtual host configuration for apache</i></p> <pre><code>&lt;VirtualHost 111.111.11.1:443&gt; ServerName www.domain.com:443 ServerAlias *.domain.com DocumentRoot /var/www/html SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW SSLCertificateFile /etc/httpd/conf.d/cert/server.crt SSLCertificateKeyFile /etc/httpd/conf.d/cert/server.key &lt;Directory "/var/www/cgi-bin"&gt; SSLOptions +StdEnvVars &lt;/Directory&gt; SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog logs/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" RewriteEngine on RewriteCond %{REQUEST_URI} !^/images RewriteCond %{HTTPS_HOST} !^www\.domain\.com$ RewriteRule ^(.+) %{HTTPS_HOST}$1 [C] RewriteRule ^([^.]+)\.domain\.com(.*) https://www.domain.com/something?subdomain=$1 [P,L] &lt;/VirtualHost&gt; </code></pre> <p>Whenever I call <a href="https://abc.domain.com" rel="noreferrer">https://abc.domain.com</a> - the response I am getting is the homepage but no matter what I am appending to the end of the subdomain, I will get the same response. It's like the rewrite isn't responding well.</p> <p>Any help would be appreciated, or if you could share how you'd setup reverse proxy, rewrite, wildcard subdomain and SSL all together</p> <p>Thanks,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload