We know that, by default Odoo is running on port 8069. And we access the odoo server in browser as ip_address:8069 or domain:8069. So this is very common query in the community that ‘How to run Odoo on port 80‘ or How to map the odoo server with a domain without port number.
What is port 80?
On a Web server or Hypertext Transfer Protocol daemon, port 80 is the port that the server “listens to” or expects to receive from a Web client, assuming that the default was taken when the server was configured or set up. A port can be specified in the range from 0-65536 on the NCSA server. However, the server administrator configures the server so that only one port number can be recognized. By default, the port number for a Web server is 80. Experimental services may sometimes be run at port 8080.
Why was port 80 chosen as the default HTTP port?
The Internet Assigned Numbers Authority (IANA) is a department of ICANN, a non-profit private corporation that oversees global IP address allocation, the Domain Name System (DNS), well-known ports, and other Internet Protocol-related symbols and numbers.
During March of 1990, they published a document (RFC 1060) where they listed all the well-known ports at that time. In that list there was no protocol assigned to port 80 (it jumped from 79 to 81).
At that time, port 80 was officially free. In 1991, Tim Berners-Lee issued the first version of HTTP in a document (HTTP 0.9) where he stated:
if the port number is not specified, 80 is always assumed for HTTP.
When we map the domain to hosting server, the domain will be pointed to static ip address using DNS service provided by the domain registrar. And the server will listen the request at port 80. Similarly when we map the domain to odoo hosting server, we have to access the odoo erp like mydomain.com:8069. So the url will have the port number 8069 or any other port number we have passed through config file.
What we need is to access the odoo erp with our domain name without mentioning any port number like mydomain.com. To do so, we have to setup nginx reverse proxy server in our odoo hosting server.
While we setup the nginx reverse proxy, if we mention the ipv4 address against ‘server_name‘ will helps to run the odoo on port 80. So we can access the odoo erp with our domain name instead of domain:port_number. The picture below shows the ip address mentioned against server_name.
sudo vim /etc/nginx/sites-enabled/default
After this changes, restart the nginx server, apache server and odoo server and you can access your odoo erp in port 80.