星期一, 12月 25, 2017

Ubuntu 16.04 odoo10 安裝及設定 Nginx Web server

安裝 Nginx.

sudo apt-get install nginx
編輯 Nginx 設定檔
sudo nano /etc/nginx/sites-enabled/default
在最下面新增,<IP_address>,換成自己對外的IP
server {
listen 80;
server_name <IP_address>;
root /var/www/example.com;
location / {
proxy_pass http://127.0.0.1:8069;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
image

存檔重重啓nginx

/etc/init.d/nginx restart

打開瀏灠器輸入 /web/login">http://<IP_address>/web/login

image