Apache: How to remove port number from URL?
-
I've just installed NodeBB on Ubuntu, Apache 2.4+. No problems so far. I can access my forum at example.com:4567
How do I remove the port number from the URL? Please note I'm using Apache, not NGINX.
-
You want to use the proxy module, like it has here:
-
Looking at the article, I have enabled the 3 modules and am now at the point where I'm trying to add the config to Apache.
I don't have a virtualhost.conf file. Should I create one?
-
@yariplus Thanks, that worked!
I can now access NodeBB by both of these URLs http://example.com:4567 and http://example.com
Is that right? Or should I now disable the http://example.com:4567 URL somehow?
-
@henrywright the best way to do that it to just block traffic outright to that port, by blocking it by firewall or similar. Also don't forget to update your config file URL to represent the URL you want to use with the proxy. Else you will have some fun issue's with emails being sent out with the port or IP.
-
@Kowlin So block port 4567 and allow port 80?
Regarding updating my config file URL, I'm not sure what you mean? My config file is currently:
{ "url": "http://example.com", "port": "4567", "secret": "55sb254c-62e3-4e23-9407-8655147562763", "database": "redis", "redis": { "host": "127.0.0.1", "port": "6379", "password": "", "database": "0" } }```
-
@henrywright Both correct.