Apache module "mod_jk". Setup rewrite condition for using https for specific url/context

5,921

Have you tried something like this (assuming you've loaded mod_rewrite)?

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

If you use Apache Httpd as a frontend, that's where SSL needs to be configured (see documentation for the mod_ssl module).

Typically, this will look like this:

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin [email protected]
        ServerName host.name.example

        SSLEngine       on
        SSLCertificateFile      /etc/ssl/certs/host.pem
        SSLCertificateKeyFile   /etc/ssl/private/host.key

        # ...
        # (the config file with your distribution will probably have
        #  a sensible set of options for SSL as well.)

        JkMount  /high/* loadbalancer
        JkMount  /low/* webworker
</VirtualHost>
</IfModule>

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName host.name.example


        # You can put the rewrite rules here for example.

        JkMount  /high/* loadbalancer
        # Don't put this one if you don't want it over plain HTTP
        # JkMount  /low/* webworker
</VirtualHost>
Share:
5,921

Related videos on Youtube

Shobhit Puri
Author by

Shobhit Puri

Updated on September 17, 2022

Comments

  • Shobhit Puri
    Shobhit Puri over 1 year

    I am having following error when I use the boxFilter function:

    SystemError: new style getargs format but argument is not a tuple
    

    Here is the code sniplet:

    //After downloading image from url, I process it as follows
    imgcv = cv2.cvtColor(np.asarray(im), cv.CV_RGB2YCrCb)
    #Get the channel 0 
    imgcv1 = cv2.split(imgcv)[0] 
    cv2.boxFilter(imgcv1, 1, 7, data, (1,1), 0, cv2.BORDER_DEFAULT)
    

    It says the argument is not a tuple. How to make it into tuples? I tried to search a lot but no helpful results. I am a beginner in openCV and in python. Here is the definition of the filter:

    cv2.boxFilter(src, ddepth, ksize[, dst[, anchor[, normalize[, borderType]]]]) → dst
    Parameters: 
        src – Source image.
        dst – Destination image of the same size and type as src .
        ksize – Smoothing kernel size.
        anchor – Anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center.
        normalize – Flag specifying whether the kernel is normalized by its area or not.
        borderType – Border mode used to extrapolate pixels outside of the image.
    

    Thanks in advance.

  • tim.kaufner
    tim.kaufner almost 14 years
    Hi Bruno, thanks for your answer, I'll try this as soon as I can :) Will reply if it works for me.
  • tim.kaufner
    tim.kaufner almost 14 years
    It really worked for me! I added my working configuration in the question :) Thank you for your hint!