Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Squid3 Reverse Proxy - how do I redirect ALL HTTP requests to HTTPS

    Scheduled Pinned Locked Moved Cache/Proxy
    2 Posts 2 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dcdefiore
      last edited by

      Good Afternoon,

      I have a squid reverse proxy set up to listen on port 80 & 443. I want to forward all port 80 requests to 443.

      Currently, for example I have:
      a.example.com
      b.example.com
      c.example.com

      If I set up a redirect mapping for a.example.com:
      Redirect Protocol: HTTP
      Blocked Domains: a.example.com
      Path Regex: ^/$
      URL to Redirect To: https://^/$

      This works to redirect a.example.com and http://a.example.com to https://a.example.com.
      This however, does not redirect a.example.com/directory.

      Ideally I'd like to put something like .example.com/ and redirect whatever the user inputs to use SSL.

      What am I missing!?

      1 Reply Last reply Reply Quote 0
      • A
        ajnozari
        last edited by

        Squid3 reverse proxy doesn't allow for keeping the path currently.  If you setup a redirect from http://mydomain.com/page.html to https://mydomain.com/page.html then you're better off setting some kind of javascript script.  You can use apache to redirect and keep the path, but in order to do so you will need to turn off ssl offloading off for that site.

        Also of note because of how Squid3 works if you want to use PHP it won't work.  This is because squid uses HTTP to connect to your webserver, unless you use SSL passthrough which something I can't figure out for pfSense, but I know is possible with the version of Squid3 that pfSense has as a package based on the squid3 documentation.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.