I have issue configuring my apache server to redirect properly. Below is what my config look like:
<VirtualHost *:80>
ServerName domain
default config...
</VirtualHost>
<VirtualHost *:80>
ServerName www.domain
{ in this www host, I'm forwarding the traffic to inner flask server }
ProxyPreserveHost On
ProxyPass / http://flask-server
ProxyPassReverse / http://flask-server
</VirtualHost>
it works as expected when I havent installed https, since I used letsencrypt to get https, I have been battling with redirection error as the server enter infinite redirect loop. I have used .htaccess to write redirection config, it doesnt work. I have used this RedirectMatch permanent ^/(.*)$ https://domain/$1 nothing change, still the improper redirect error.
Thanks boss. I’m not familiar with nginx, I will use this as instructed. Please, provide a course on nginx. It will help a lot before I go for my sysadmin course.