I have the following apache configuration file for a reverse proxy :
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
ProxyPreserveHost On
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
ErrorLog /var/log/apache2/NewPC-error.log
CustomLog /var/log/apache2/NewPC-access.log common
SSLEngine on
SSLProtocol all -SSLv2
SSLCertificateFile /etc/ssl/private/localhost.crt
SSLCertificateKeyFile /etc/ssl/private/localhost.key
</VirtualHost>
The reverse proxy works properly bu I always have the port number (5000) in the URL.
Is there any way to remove if please ?
Regards,
Copyright Notice:Content Author:「Thomas Carlton」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/65646304/apache2-how-to-remove-port-from-url