connect through WAN gateway to host through vbox to VM through nginx proxy to odoo
I put a port forward on my Comcast xfinity gateway to my Ubuntu host PC.
The Ubuntu host runs VirtualBox where I defined a forward port from the one from the gateway to an Ubuntu VM which hosts my Odoo app.
Odoo has a builtin web server (Werkzueg or something like that) that does not support HTTPS, so I installed nginx on the VM to proxy/reverse proxy Odoo using HTTPS.
Internet --> modem port forward --> Ubuntu host --> virtualbox port forward --> Ubuntu vm --> nginx --> Odoo
One thing: without nginx installed, and using plain HTTP, I can connect to my Odoo app from my tablet at the restaurant no problem. Only I don't want to do that.
Modem is TECHNICOLOR CGM4140COM which does support port forward.
nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
default.conf:
deleted
odoo10.conf
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
# http -> https
server {
listen 80;
server_name odoo.mycompany.com;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name odoo.mycompany.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# SSL parameters
ssl on;
ssl_certificate /etc/nginx/ssl/odoo10.cert;
ssl_certificate_key /etc/nginx/ssl/odoo10.key;
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# log
access_log /etc/nginx/odoo10.access.log;
error_log /etc/nginx/odoo10.error.log debug;
# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
# common gzip
gzip_types text/css text/less text/plain text/xml application/xml
application/json application/javascript;
gzip on;
}
From the internet I can connect to my Odoo app with https and it works to some extent. But there are some problems I'd like to solve.
When I enter https://my-modem-IP:port I will receive my modem admin login page. So I need to enter https://my-modem-IP:port/web/login. When I do this I receive the Odoo login page. And the URL that is returned back is the same as I sent: https://my-modem-IP:port/web/login.
When I click on that I again receive the modem admin login page with https://my-modem-IP/web -- no port#.
If I manually enter the port# to that URL -- https://my-modem-IP:port/web -- I am logged into the Odoo app. I have not tested the complete app, but so far there is no problem navigating through it, except for the logout page which again drops the port# and sends me the modem admin logon page.
I have two debug logs: one that gives me the login problem and another that shows it works when I manually enter the port#. They are quite large and maybe this is not the place to include them. I hope someone will let me know a way I can post the logs.
virtualbox https nginx reverse-proxy odoo
add a comment |
I put a port forward on my Comcast xfinity gateway to my Ubuntu host PC.
The Ubuntu host runs VirtualBox where I defined a forward port from the one from the gateway to an Ubuntu VM which hosts my Odoo app.
Odoo has a builtin web server (Werkzueg or something like that) that does not support HTTPS, so I installed nginx on the VM to proxy/reverse proxy Odoo using HTTPS.
Internet --> modem port forward --> Ubuntu host --> virtualbox port forward --> Ubuntu vm --> nginx --> Odoo
One thing: without nginx installed, and using plain HTTP, I can connect to my Odoo app from my tablet at the restaurant no problem. Only I don't want to do that.
Modem is TECHNICOLOR CGM4140COM which does support port forward.
nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
default.conf:
deleted
odoo10.conf
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
# http -> https
server {
listen 80;
server_name odoo.mycompany.com;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name odoo.mycompany.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# SSL parameters
ssl on;
ssl_certificate /etc/nginx/ssl/odoo10.cert;
ssl_certificate_key /etc/nginx/ssl/odoo10.key;
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# log
access_log /etc/nginx/odoo10.access.log;
error_log /etc/nginx/odoo10.error.log debug;
# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
# common gzip
gzip_types text/css text/less text/plain text/xml application/xml
application/json application/javascript;
gzip on;
}
From the internet I can connect to my Odoo app with https and it works to some extent. But there are some problems I'd like to solve.
When I enter https://my-modem-IP:port I will receive my modem admin login page. So I need to enter https://my-modem-IP:port/web/login. When I do this I receive the Odoo login page. And the URL that is returned back is the same as I sent: https://my-modem-IP:port/web/login.
When I click on that I again receive the modem admin login page with https://my-modem-IP/web -- no port#.
If I manually enter the port# to that URL -- https://my-modem-IP:port/web -- I am logged into the Odoo app. I have not tested the complete app, but so far there is no problem navigating through it, except for the logout page which again drops the port# and sends me the modem admin logon page.
I have two debug logs: one that gives me the login problem and another that shows it works when I manually enter the port#. They are quite large and maybe this is not the place to include them. I hope someone will let me know a way I can post the logs.
virtualbox https nginx reverse-proxy odoo
add a comment |
I put a port forward on my Comcast xfinity gateway to my Ubuntu host PC.
The Ubuntu host runs VirtualBox where I defined a forward port from the one from the gateway to an Ubuntu VM which hosts my Odoo app.
Odoo has a builtin web server (Werkzueg or something like that) that does not support HTTPS, so I installed nginx on the VM to proxy/reverse proxy Odoo using HTTPS.
Internet --> modem port forward --> Ubuntu host --> virtualbox port forward --> Ubuntu vm --> nginx --> Odoo
One thing: without nginx installed, and using plain HTTP, I can connect to my Odoo app from my tablet at the restaurant no problem. Only I don't want to do that.
Modem is TECHNICOLOR CGM4140COM which does support port forward.
nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
default.conf:
deleted
odoo10.conf
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
# http -> https
server {
listen 80;
server_name odoo.mycompany.com;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name odoo.mycompany.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# SSL parameters
ssl on;
ssl_certificate /etc/nginx/ssl/odoo10.cert;
ssl_certificate_key /etc/nginx/ssl/odoo10.key;
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# log
access_log /etc/nginx/odoo10.access.log;
error_log /etc/nginx/odoo10.error.log debug;
# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
# common gzip
gzip_types text/css text/less text/plain text/xml application/xml
application/json application/javascript;
gzip on;
}
From the internet I can connect to my Odoo app with https and it works to some extent. But there are some problems I'd like to solve.
When I enter https://my-modem-IP:port I will receive my modem admin login page. So I need to enter https://my-modem-IP:port/web/login. When I do this I receive the Odoo login page. And the URL that is returned back is the same as I sent: https://my-modem-IP:port/web/login.
When I click on that I again receive the modem admin login page with https://my-modem-IP/web -- no port#.
If I manually enter the port# to that URL -- https://my-modem-IP:port/web -- I am logged into the Odoo app. I have not tested the complete app, but so far there is no problem navigating through it, except for the logout page which again drops the port# and sends me the modem admin logon page.
I have two debug logs: one that gives me the login problem and another that shows it works when I manually enter the port#. They are quite large and maybe this is not the place to include them. I hope someone will let me know a way I can post the logs.
virtualbox https nginx reverse-proxy odoo
I put a port forward on my Comcast xfinity gateway to my Ubuntu host PC.
The Ubuntu host runs VirtualBox where I defined a forward port from the one from the gateway to an Ubuntu VM which hosts my Odoo app.
Odoo has a builtin web server (Werkzueg or something like that) that does not support HTTPS, so I installed nginx on the VM to proxy/reverse proxy Odoo using HTTPS.
Internet --> modem port forward --> Ubuntu host --> virtualbox port forward --> Ubuntu vm --> nginx --> Odoo
One thing: without nginx installed, and using plain HTTP, I can connect to my Odoo app from my tablet at the restaurant no problem. Only I don't want to do that.
Modem is TECHNICOLOR CGM4140COM which does support port forward.
nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
default.conf:
deleted
odoo10.conf
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
# http -> https
server {
listen 80;
server_name odoo.mycompany.com;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name odoo.mycompany.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# SSL parameters
ssl on;
ssl_certificate /etc/nginx/ssl/odoo10.cert;
ssl_certificate_key /etc/nginx/ssl/odoo10.key;
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# log
access_log /etc/nginx/odoo10.access.log;
error_log /etc/nginx/odoo10.error.log debug;
# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
# common gzip
gzip_types text/css text/less text/plain text/xml application/xml
application/json application/javascript;
gzip on;
}
From the internet I can connect to my Odoo app with https and it works to some extent. But there are some problems I'd like to solve.
When I enter https://my-modem-IP:port I will receive my modem admin login page. So I need to enter https://my-modem-IP:port/web/login. When I do this I receive the Odoo login page. And the URL that is returned back is the same as I sent: https://my-modem-IP:port/web/login.
When I click on that I again receive the modem admin login page with https://my-modem-IP/web -- no port#.
If I manually enter the port# to that URL -- https://my-modem-IP:port/web -- I am logged into the Odoo app. I have not tested the complete app, but so far there is no problem navigating through it, except for the logout page which again drops the port# and sends me the modem admin logon page.
I have two debug logs: one that gives me the login problem and another that shows it works when I manually enter the port#. They are quite large and maybe this is not the place to include them. I hope someone will let me know a way I can post the logs.
virtualbox https nginx reverse-proxy odoo
virtualbox https nginx reverse-proxy odoo
asked Feb 18 at 17:37
two4twotwo4two
1
1
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I fixed it. I added the desired port# as follows:
proxy_set_header X-Forwarded-Host $host:6789;
I also eliminate the listed on 80 since I will not accept it anyway. I only accept https.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1407117%2fconnect-through-wan-gateway-to-host-through-vbox-to-vm-through-nginx-proxy-to-od%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I fixed it. I added the desired port# as follows:
proxy_set_header X-Forwarded-Host $host:6789;
I also eliminate the listed on 80 since I will not accept it anyway. I only accept https.
add a comment |
I fixed it. I added the desired port# as follows:
proxy_set_header X-Forwarded-Host $host:6789;
I also eliminate the listed on 80 since I will not accept it anyway. I only accept https.
add a comment |
I fixed it. I added the desired port# as follows:
proxy_set_header X-Forwarded-Host $host:6789;
I also eliminate the listed on 80 since I will not accept it anyway. I only accept https.
I fixed it. I added the desired port# as follows:
proxy_set_header X-Forwarded-Host $host:6789;
I also eliminate the listed on 80 since I will not accept it anyway. I only accept https.
answered Feb 20 at 4:38
two4twotwo4two
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1407117%2fconnect-through-wan-gateway-to-host-through-vbox-to-vm-through-nginx-proxy-to-od%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown