安裝nginx
sudo apt-get install -y nginx
修改配置文件
vi /etc/nginx/nginx.conf
#注釋掉下面這行代碼
#include /etc/nginx/sites-enabled/*;
#保存
在/etc/nginx/conf.d目錄下新建一個配置文件
vi /etc/nginx/conf.d/www.example.com.conf
#加入下面的代碼
server {
listen 80;
server_name www.example.com;
location / {
proxy_pass http://localhost:8069;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
#保存
service nginx restart #重啟nginx服務(wù)
在瀏覽器中打開www.example.com便可訪問到odoo了。