2022 m. rugpjūčio 10 d., trečiadienis

Host odoo dev port to name

How to map dev-project1/ to http://localhost:8090/, so that you can go to http://dev-project1/ and be redirected to odoo website?


  1. Install nginx
  2. sudo nano /etc/nginx/sites-available/default


server {

    listen 80;

    server_name mywebsite;

    location / {

            proxy_set_header X-Forwarded-Host $host;

            proxy_set_header Host "mywebsite";

            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

            proxy_set_header X-Real-IP $remote_addr;

        proxy_pass http://127.0.0.1:8070/;

    }

}


3. Change /etc/hosts file


127.0.0.1 mywebsite


3. Restart server:

sudo systemctl restart  nginx