[PLUG] Apache issue in Debian 8.10

Arun Khan knura9 at gmail.com
Sat Jul 7 00:11:41 IST 2018


On Wed, Jul 4, 2018 at 1:47 AM, Amey Abhyankar <sco1984 at gmail.com> wrote:
>>> I am currently directing Jenkin request from http to https
>>> i.e. when somebody hits http://jenkins.mydomain.com it goes to https://jenkins
>>> But since I added new conf file in apache, jenkins redirection is not happening.
>>>
>>
>> Without sharing the conf files, it's difficult to help.
>
> Here is the conf file [from /etc/apache2/sites-available] which is not
> redirecting my jenkins URL from http to https =
>
> ------------------------------------------------------
> <VirtualHost *:80>
>  ServerAdmin admin at mydomain.com
>  ServerName jenkins.mydomain.com
>
>  RewriteEngine On
>  RewriteOptions Inherit
>
>  ProxyPass / http://127.0.0.1:8080/ nocanon retry=0
>  ProxyPassReverse / http://127.0.0.1:8080/
>  ProxyPreserveHost On
>  ProxyRequests     Off
>  AllowEncodedSlashes NoDecode
>
>  <Proxy http://127.0.0.1:8080/*>
>   Order deny,allow
>   Allow from all
>  </Proxy>
>
>  ErrorLog /var/log/apache2/jenkins-mydomain-com-error.log
>  LogLevel warn
>  CustomLog /var/log/apache2/jenkins-mydomain-com-access.log combined
>  ServerSignature On
>
> ------------------------------------------------------

I have not used the Apache Proxy directives and I am assuming all that
stuff is working for HTTP mode.

You have "RewriteOptions Inherit"  but who is doing the Rewrite for
HTTP to HTTPS?

I don't see any HTTP > HTTPS rewrite in the above.

Snippet from my HTTP-site.conf file.
Ensure mod_rewrite mod_ssl etc are enabled.

################  site file for port 80 ################
### Rewrite HTTP to HTTPS
        RewriteEngine On

        # This checks to make sure the connection is not already HTTPS

        RewriteCond %{HTTPS} !=on
        RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

################  site file for port 80 ################

There are several variations on this, use your fav search engine if
the above does not work for you.

HTH,
-- Arun Khan


More information about the plug-mail mailing list