Navigation

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

    How to solve http / https / www

    Off-Topic & Non-Support Discussion
    2
    3
    49
    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.
    • G
      gusto last edited by

      I have an LXC container in a virtualized Proxmox VE environment. This LXC runs an apache web server with 4 web pages

      Config file for www.my-domain.dyndns.com

      /etc/apache2/sites-available/www.my-domain.dyndns.com.conf
      
      <VirtualHost *:80>
              DocumentRoot /var/www/www.my-domain.dyndns.com
              ServerName my-domain.dyndns.com
              ServerAlias www.my-domain.dyndns.com
              ServerAdmin webmaster@my-domain.dyndns.com
              RewriteEngine on
              RewriteCond %{HTTP_HOST} ^my-domain\.dyndns\.com$ [NC]
              RewriteRule ^(.*)$ http://www.my-domain.dyndns.com$1 [R=301,NE,L]
              RewriteCond %{HTTPS} off
              RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
      </VirtualHost>
       
      <VirtualHost *:443>
              DocumentRoot /var/www/www.my-domain.dyndns.com
              ServerName my-domain.dyndns.com
              ServerAlias www.my-domain.dyndns.com
              ServerAdmin webmaster@my-domain.dyndns.com
        <IfModule mod_ssl.c>
              SSLEngine on
              SSLCertificateKeyFile /etc/letsencrypt/live/my-domain.dyndns.com/privkey.pem
              SSLCertificateFile /etc/letsencrypt/live/my-domain.dyndns.com/cert.pem
              SSLCertificateChainFile /etc/letsencrypt/live/my-domain.dyndns.com/chain.pem
      #       SSLCertificateChainFile /etc/letsencrypt/live/my-domain.dyndns.com/fullchain.pem
        </IfModule>
              RewriteEngine on
              RewriteCond %{HTTP_HOST} ^my-domain\.ddns\.com$ [NC]
              RewriteRule ^(.*)$ https://www.my-domain.dyndns.com$1 [R=301,NE,L]
      </VirtualHost>
      

      Until now, I used a routerboard (Mikrotik) and everything worked great. The configuration file is set as follows
      When the client writes to the url

      my-domain.dyndns.com
      www.my-domain.dyndns.com
      http://www.my-domain.dyndns.com
      https://www.my-domain.dyndns.com
      

      so it always redirects to

      https://www.my-domain.dyndns.com
      

      I've been using pfsense for about 2 days now and it doesn't work. When the client writes to the url

      my-domain.dyndns.com
      www.my-domain.dyndns.com
      http://www.my-domain.dyndns.com
      

      the webpage will not be displayed. When the client writes to the url

      https://my-domain.dyndns.com
      https://www.my-domain.dyndns.com
      

      then it works great.
      Now I don't know where the mistake is. Do I need to change anything in the apache configuration or in pfsense?

      Firewall/NAT

      1 Reply Last reply Reply Quote 0
      • V
        viragomann last edited by

        So forward HTTP as well to the server.

        1 Reply Last reply Reply Quote 0
        • G
          gusto last edited by

          Hi
          I completely forgot about it.
          thanks

          1 Reply Last reply Reply Quote 0
          • First post
            Last post