Skip to Content
Menu
This question has been flagged
4 Replies
3900 Views

Hi Dears,


I am using Odoo 10. I have implemented subdomain using Nginx with below script and it is working fine. However When I type IP address with port number like http://444.444.444.44:8085/web/database/manager,  still im able to access this page. I want users forcibly use subdomain only as I provided xxx.mydomain.com. How can I achieve this plz help.


My script for each of my subdoain URL is as follows:


server {
        listen       80;
        listen       [::]:80;
        server_name  xxx.mydomain.org;
        root         /usr/share/nginx/html;

        include /etc/nginx/default.d/*.conf;

    location / {
        proxy_pass http://127.0.0.1:8085;
        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 $scheme;
        proxy_connect_timeout       2000;
        proxy_send_timeout          2000;
        proxy_read_timeout          2000;
        send_timeout                2000;
    }


    location ~* /web/database/manager {

        deny all;
    }

    location ~* /web/database/selector {

        deny all;
    }


        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }



Avatar
Discard
Best Answer

Your mixing different elements here. Can you please post your nginx.conf file usually /etc/nginx/nginx.conf and the conf file in sites-enabled folder for the sub-domain. This would help to see the issue. I can see your missing upstream and proxy redirect is off but I have to see what is happening here. 

Avatar
Discard
Best Answer

Did you set proxy_mode = True in your Odoo conf file? Please check the documentation for more information about deployment: https://www.odoo.com/documentation/13.0/setup/deploy.html#

Avatar
Discard
Author

I tried what you said. and restarted the server. still im able to load the page of selector. http://444.444.444.44:8085/web/database/selector