Skip to Content
Menu
This question has been flagged
1 Reply
10091 Views

Hi all,

I am new to nginx and setup my server for reverse proxy my odoo instance.I am not using https for now since need to be familiar with nginx first before going to a higher level of setup.

Everything seems to be working fine. When I enter my subdomain name, I can see the login page for my Odoo instance and browser address bar shows my subdomain.

My problem is that, after log in with Google Chrome (and also with IE) browser bar shows the IP_address:port instead of subdomain. Testes with firefox and works fine. My script for nginx is (UPPER case replaced by subdomain and IP):

#worker_processes 1;

#events {

# worker_connections 1024;

#}

server {

listen 80;

server_name SUBDOMAIN.DOMAIN.CO;

location /socket.io {

proxy_pass http://SERVER_IP:8069;

proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

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;

proxy_redirect off;

}

location / {

proxy_pass http://SERVER_IP:8069;

}

}

Can anyone help me solve it?

Thank you very much

Paulo

Avatar
Discard
Best Answer

You need to do for location "/" the same that you are doing for the location "/socket.io" except for the http 1.1 part. Define location "/" as:


    location / {

        proxy_pass http://SERVER_IP:8069;

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;

        proxy_redirect off;

    }



Avatar
Discard
Related Posts Replies Views Activity
1
Jan 24
11858
1
Sep 24
7193
2
Sep 24
425
1
May 24
2093
2
May 24
12878