Odoo Help


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

Pascal Tremblay
on 7/7/15, 9:09 AM 1,248 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 : (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 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 {

                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;


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

Thanks for your comment. So, if I well understand, I'm losing my time with this. I can use 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
On 7/8/15, 3:57 AM

Yes you can, but, you need to bind odoo to listen only to requests, (in config file set : proxy_mode = True, xmlrpc_interface =, also xmprpcs_interface= 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
Pascal Tremblay
On 7/8/15, 8:13 AM

Thanks all for your precious comments.

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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