You are not logged in.
Hello,
I'm trying to run nginx as a reverse proxy to serve odoo via odoo.example.com. I have nginx listening on port 225 for plain traffic and 543 for ssl traffic since apache is listening to ports 80 and 443 respectively for nextcloud.
Apache is serving nextcloud fine. When I type ipadress:8069 for odoo, (the port its built in webserver listens to) I get connected. However when I type in the FQN odoo.example.com, nginx doesn't serve ipaddress:8063. Proxy pass is set to http://ipaddress:8069. The server name is set to odoo.example.com in nginx.
Both webservers use certbot letsencrypt ssl configuration with a redirect. Nextcloud uses mariadb for its database backend and odoo's webserver uses postgresql for its database backend.
Port forwarding is set up correctly with the correct host records pointing the subdomains to the right public IP address. I wilm input config files when I'm out of work. Please let me know of some suggestions.
Last edited by bikerpierre (2019-01-17 06:31:02)
Offline
Apache is serving nextcloud fine. When I type ipadress:8069 for odoo, (the port its built in webserver listens to) I get connected. However when I type in the FQN odoo.example.com, nginx doesn't serve ipaddress:8063. Proxy pass is set to http://ipaddress:8069. The server name is set to odoo.example.com in nginx
Isn't that to be expected?
If you want to access odoo via nginx you should be trying to visit odoo.example.com:225 as that's the port nginx is listening to.
If you want to access everything via ports 80/443 then use nginx as a reverse proxy for both applications (or just reverse-proxy odoo and serve nextcloud natively with nginx).
Offline
upstream odoo {
server ipaddress:8069;
}
server {
listen 225;
server_name odoo.example.com;
root /usr/share/nginx/html;
index index.html index.htm;
access_log /var/log/nginx/odoo-example-com.access.log;
error_log /var/log/nginx/odoo-example-com.error.log;
location / {
proxy_pass http://ipaddress:8069;
# force timeouts if the backend dies
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
# set headers
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 https;
}
# cache some static data in memory for 60mins
location ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://ipaddress:8069;
}
listen 543 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/odoo.example.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/odoo.example.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
When I type odoo.example.com:225, I still get a connection error
Last edited by bikerpierre (2019-01-16 13:13:51)
Offline
Worse comes to worst I'll try your method, but I really don't want to reconfigure apache and disrupt nextcloud
Offline
1) In your OP you (also) mentioned port 8063. Was this a typo or did you mix up port numbers?
2) "odoo.example.com" is not a FQDN. There's a dot missing at the end, but this should not matter to your browser or reverse proxy.
3) You only proxy pass http connections to the respective port. If the provider has a redirection in place, this will yield a status of 30x and cause the proxy to fail. Google it.
Update: If you want more detailed help, provide nginx's logs.
Last edited by schard (2019-01-16 13:17:38)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
If you want to access everything via ports 80/443 then use nginx as a reverse proxy for both applications (or just reverse-proxy odoo and serve nextcloud natively with nginx).
Or keep nextcloud natively in apache and add a virtual host with ProxyPass for odoo in apache.
Last edited by progandy (2019-01-16 14:57:26)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Slithery wrote:If you want to access everything via ports 80/443 then use nginx as a reverse proxy for both applications (or just reverse-proxy odoo and serve nextcloud natively with nginx).
Or keep nextcloud natively in apache and add a virtual host with ProxyPass for odoo in apache.
Apologies for the typos; I was at work and needed to type fast. I'm going to do this and see what happens. Thank you everyone
Offline
Or keep nextcloud natively in apache and add a virtual host with ProxyPass for odoo in apache.
That did spring to my mind, but it's been at least a decade since I've used Apache and I wasn't sure if that was a thing yet
Offline
Ok it works now. I set up apache natively serving nextcloud with odoo running inside a virtual host and reverse proxy. Thank you everyone. I will mark solved.
Last edited by bikerpierre (2019-01-17 06:28:45)
Offline