Apache2 : How to remove port from URL?
NickName:Thomas Carlton Ask DateTime:2021-01-10T02:43:24

Apache2 : How to remove port from URL?

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

More about “Apache2 : How to remove port from URL?” related questions

Apache2 : How to remove port from URL?

I have the following apache configuration file for a reverse proxy : &lt;VirtualHost *:80&gt; RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R...

Show Detail

Docker and apache2, remove port from url

I'm working with Docker on an Ubuntu server, and I have an Apache2 container. This container is working, if I go to http://my-server-ip:8080, I can see my folders and files in the folder /var/ww...

Show Detail

How to avoid port number in django app url in comination with apache2

My django website is hosted on ubuntu apache2 vps which reserves port 80. I want to hide or avoid portnumber in django url. By googling i learnt using port 80 will help for that. But apache2 has re...

Show Detail

Remove Port Number from URL Thin Server 1.5 with Rails 3

I have a small Rails app currently being served (dev and production) by Thin server on port 3000, on a Debian box that also has apache2 running, serving PHP applications. I am not certain if this is

Show Detail

Apache2: Rewrite url to different port on localhost

There is a service on my local computer available on 127.0.0.1:8080, but I would prefer to use it rather like 127.0.0.1/qwerty/ I tried to add in /etc/apache2/sites-available/default: RewriteEngi...

Show Detail

How to restrict Apache2 to listen from port 80?

I have changed some files, but still the Apache2 listen from the 80 port. Edited this line "Listen 44400" to the file ports.conf Edited this "VirtualHost *:44400" to the file /site-enabled/000-def...

Show Detail

Browsersync remove port from url

I am trying to remove port number from url in Browsersync (with webpack). new BrowserSyncPlugin({ host: 'test.local', proxy: 'https://test.local', open: 'external', files: ['**/*.cs...

Show Detail

remove port number from the url

I have two instances of tomcat on a single machine both instances accepting secure request. Suppose: one has connector port configured as 8080 and redirect port as 443. The other one has connector ...

Show Detail

How to remove or hide port no from url?

I have created a web application using blazor asp net core and publish as a folder profile, it is working fine on https://192.168.0.3:5001 but i want to remove/hide the port no from url. i am not u...

Show Detail

How to remove the Port number from my url?

I am using Apache Tomcat6.0.i am relatively new to servers.i want to remove my port number from my URL.i searched for the listening port it is "wampapache". Example: localhost:8080/myappname...

Show Detail