Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Should I accept requests on IP:8070 event with nginx?

By
Pascal Tremblay
on 7/7/15, 9:09 AM 823 views

Hello there,

We now have nginx installed on Our Ubuntu 14.04. it seems a great software. 

Now, we can enter test.lapagept.com (port 80) to get our original address : 223.26.196.31:8070 (odoo test server). Our domain name (test.lapagept.com) stays in the browser's address bar. No port number is displayed. good.

But what happens with those one they have this old 23.226.196.31:8070 bookmarked? They still want to connect with this old address...

We are trying this (bold) setup in our /etc/nginx/sites-enabledtest.lapagept.com file :

        upstream odoo-test {

                server 127.0.0.1:8070;

        }

        server {

                listen 443;

                server_name test.lapagept.com;

                access_log /var/log/nginx/test.lapagept.com.access.log;

                error_log /var/log/nginx/test.lapagept.com.error.log;

                ssl on;

                ssl_certificate /etc/nginx/ssl/server.crt;

                ssl_certificate_key /etc/nginx/ssl/server.key;

                keepalive_timeout 60;

                ssl_ciphers HIGH:!ADH:!MD5;

                ssl_protocols SSLv3 TLSv1;

                ssl_prefer_server_ciphers on;

                proxy_buffers 16 64k;

                proxy_buffer_size 128k;

                location / {

                    proxy_pass http://odoo-test;

                    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

                    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 https;            

                }

                location ~* /web/static/ {

                    proxy_cache_valid 200 60m;

                    proxy_buffering on;

                    expires 864000;

                    proxy_pass http://odoo-test;

                }

}

# This allows for someone to go to http and get redirected to https automatically

    server {

        listen 80;

        server_name test.lapagept.com;

        add_header Strict-Transport-Security max-age=2592000;

        return 301 http://test.lapagept.com$request_uri;

    }

# This allows for someone to go to http and get redirected to https automatically

    server {

        listen 8070;

        server_name 23.226.196.31;

        add_header Strict-Transport-Security max-age=2592000;

        return 301 http://test.lapagept.com$request_uri;

    }


Without the bold lines, all seems good.

With the bold lines, we get this error :

    nginx: [emerg] bind() to 23.226.196.31:8070 failed (99: Cannot assign requested address)


Could you help please? Idea?

I use Apache myself, so I'm not firm with nginx, but why don't you use the same URL rewrite for port 8070 as for port 80 (with the $request_uri part appended)?

Ermin Trevisan
on 7/7/15, 9:35 AM

Corrected. Result is the same. Thanks.

Pascal Tremblay
on 7/7/15, 10:12 AM

Ideas? hmmm - add odoo-test.lapagept.com to the server_name - put the 8070 server block before the 80 server block Maybe you give it a try...

Ermin Trevisan
on 7/7/15, 10:48 AM

(update above, ermin trevisan means test.lapagept.com)

Pascal Tremblay
on 7/7/15, 11:26 AM
1
Maxime Chambreuil
On 7/7/15, 6:36 PM

I may have missed something but you can't have two applications (Odoo and Nginx) listenning on the same port (8070).

If you haven't touched your firewall configuration, users should still be able to access http://23.226.196.31:8070

Thanks for your comment. So, if I well understand, I'm losing my time with this. I can use http://23.226.196.31:8070 in my browser, but it won't be rename in the browser address bar for http://test.lapagept.com... This is not a problem. I try this soon.

Pascal Tremblay
on 7/7/15, 8:45 PM
1

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 7/8/15, 3:57 AM

Yes you can, but, you need to bind odoo to listen only to 127.0.0.1 requests, (in config file set : proxy_mode = True, xmlrpc_interface = 127.0.0.1, also xmprpcs_interface=127.0.0.1) then you can make nginx listen to 8070 and even redirect 8070 (old bookmark) to https (443) ... hope it helps

VEry interesting. We are near of the Verity! thanks

Pascal Tremblay
on 7/8/15, 4:52 AM
-1

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 7/8/15, 8:13 AM

Thanks all for your precious comments.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/7/15, 9:09 AM
Seen: 823 times
Last updated: 7/8/15, 8:13 AM