Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3 Antworten
3587 Ansichten

Hello: 


The website editor won't load for me.. just hangs on spinning wheel.. I have Odoo v 17 installed using docker and passing through a proxy, NGINX Proxy manager, feeding from Cloudflare. 

I have tried everything I could thing of, the most common thing I've found was to add the line "add_header 'Content-Security-Policy' 'upgrade-insecure-requests';" to NGINX custom locations.. I had version 16 installed earlier this week and this did solve the issue but it doesn't seem to do the trick for 17.. 


Any advise is greatly appreciated. 

Thanks in advance. 

Tim.

Avatar
Verwerfen
Autor

Hey Hans.

the NGINX I'm is the NGINX proxy manager in a docker container such as shown here: https://nginxproxymanager.com/screenshots/ .. It's not in such "config" file to post..

Beste Antwort

maybe share your nginx config, so we can help you better.


Your Screenshots are super blurry, but I faced the same issue with nginxproxymanager a couple of days ago.

You need to edit the config manually and not open it again in NPM (it will override the settings)

I hope you are using NPM with a docker volume, that makes editing the files much easier. If you are using the same docker-compose as I did you find the conf files in ../dockerproject/data/nginx/proxy_host


# ------------------------------------------------------------

#  xxx

# ------------------------------------------------------------



map $http_upgrade $connection_upgrade {

  default upgrade;

  ''      close;

}


map $sent_http_content_type $content_type_csp {

    default "";

    ~image/ "default-src 'none'";

}





server {

  set $forward_scheme http;

  set $server         „xx.xx.xx.xx.“;

  set $port           xxxx;


  listen 80;

listen [::]:80;


listen 443 ssl http2;

listen [::]:443 ssl http2;



  server_name xxxx.xx;



  # Let's Encrypt SSL

  include conf.d/include/xxx;

  include conf.d/include/xxx

  ssl_certificate /etc/letsencrypt/lxxx;

  ssl_certificate_key /etc/letsencrypt/xxx;







  # Block Exploits

  include conf.d/include/block-exploits.conf;




  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

  add_header Strict-Transport-Security "max-age=63072000;includeSubDomains; preload" always;

  add_header Referrer-Policy strict-origin-when-cross-origin; 

  add_header X-Content-Type-Options nosniff;

  add_header X-XSS-Protection "1; mode=block";

  add_header X-Frame-Options SAMEORIGIN;

  add_header Content-Security-Policy upgrade-insecure-requests;

  add_header Permissions-Policy interest-cohort=();

  add_header Expect-CT 'enforce; max-age=604800';

  more_set_headers 'Server: Proxy';

  more_clear_headers 'X-Powered-By';





    # Force SSL

    include conf.d/include/force-ssl.conf;





proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection $http_connection;

proxy_http_version 1.1;



  access_log /data/logs/proxy-host-33_access.log proxy;

  error_log /data/logs/proxy-host-33_error.log warn;








  location /websocket {

    proxy_set_header Host $host;

    proxy_set_header X-Forwarded-Scheme $scheme;

    proxy_set_header X-Forwarded-Proto  $scheme;

#    proxy_set_header X-Forwarded-For    $remote_addr;

#Odoo

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header Connection $connection_upgrade;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_pass       http://xx.xx.xx.xx:xxxxxx;



#from odoo

    proxy_set_header X-Forwarded-Host $http_host;

    proxy_cookie_flags session_id samesite=lax secure;


  # Block Exploits

  include conf.d/include/block-exploits.conf;



    # Force SSL

    include conf.d/include/force-ssl.conf;





  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

  add_header Strict-Transport-Security "max-age=63072000;includeSubDomains; preload" always;

  add_header Referrer-Policy strict-origin-when-cross-origin;

  add_header X-Content-Type-Options nosniff;

  add_header X-XSS-Protection "1; mode=block";

  add_header X-Frame-Options SAMEORIGIN;

  add_header Content-Security-Policy upgrade-insecure-requests;

  add_header Permissions-Policy interest-cohort=();

  add_header Expect-CT 'enforce; max-age=604800';

  more_set_headers 'Server: Proxy';

  more_clear_headers 'X-Powered-By';






    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection $http_connection;

    proxy_http_version 1.1;





  }



  location /longpolling {

    proxy_set_header Host $host;

    proxy_set_header X-Forwarded-Scheme $scheme;

    proxy_set_header X-Forwarded-Proto  $scheme;

#    proxy_set_header X-Forwarded-For    $remote_addr;

#Odoo

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header Connection $connection_upgrade;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_pass       http://xx.xx.xx.xx:xxxxx;



#from odoo

    proxy_set_header X-Forwarded-Host $http_host;

    proxy_cookie_flags session_id samesite=lax secure;


  # Block Exploits

  include conf.d/include/block-exploits.conf;



    # Force SSL

    include conf.d/include/force-ssl.conf;





  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

  add_header Strict-Transport-Security "max-age=63072000;includeSubDomains; preload" always;

  add_header Referrer-Policy strict-origin-when-cross-origin;

  add_header X-Content-Type-Options nosniff;

  add_header X-XSS-Protection "1; mode=block";

  add_header X-Frame-Options SAMEORIGIN;

  add_header Content-Security-Policy upgrade-insecure-requests;

  add_header Permissions-Policy interest-cohort=();

  add_header Expect-CT 'enforce; max-age=604800';

  more_set_headers 'Server: Proxy';

  more_clear_headers 'X-Powered-By';






    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection $http_connection;

    proxy_http_version 1.1;





  }



  location / {






  # HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

  add_header Strict-Transport-Security "max-age=63072000;includeSubDomains; preload" always;

  add_header Referrer-Policy strict-origin-when-cross-origin;

  add_header X-Content-Type-Options nosniff;

  add_header X-XSS-Protection "1; mode=block";

  add_header X-Frame-Options SAMEORIGIN;

  add_header Content-Security-Policy upgrade-insecure-requests;

  add_header Permissions-Policy interest-cohort=();

  add_header Expect-CT 'enforce; max-age=604800';

  more_set_headers 'Server: Proxy';

  more_clear_headers 'X-Powered-By';



#odoo

    proxy_set_header X-Forwarded-Host $http_host;

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_redirect off;

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

    proxy_cookie_flags session_id samesite=lax secure;

#Odoo Ende

    add_header Content-Security-Policy upgrade-insecure-requests;




    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection $http_connection;

    proxy_http_version 1.1;



    # Proxy!

    include conf.d/include/proxy.conf;

  }




    location @odoo {

# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

  add_header Strict-Transport-Security "max-age=63072000;includeSubDomains; preload" always;

  add_header Referrer-Policy strict-origin-when-cross-origin;

  add_header X-Content-Type-Options nosniff;

  add_header X-XSS-Protection "1; mode=block";

  add_header X-Frame-Options SAMEORIGIN;

  add_header Content-Security-Policy upgrade-insecure-requests;

  add_header Permissions-Policy interest-cohort=();

  add_header Expect-CT 'enforce; max-age=604800';

  more_set_headers 'Server: Proxy';

  more_clear_headers 'X-Powered-By';



#odoo

    proxy_set_header X-Forwarded-Host $http_host;

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_redirect off;

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

    proxy_cookie_flags session_id samesite=lax secure;

#Odoo Ende


    add_header Content-Security-Policy upgrade-insecure-requests;



    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection $http_connection;

    proxy_http_version 1.1;



    # Proxy!

    include conf.d/include/proxy.conf;

    }


    # Serve static files right away

    location ~ ^/[^/]+/static/.+$ {

        # root and try_files both depend on your addons paths

        root ...;

        try_files ... @odoo;

        expires 24h;

        add_header Content-Security-Policy $content_type_csp;

    }


  # common gzip

  gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;

  gzip on;


  # Custom

  #include /data/nginx/custom/server_proxy[.]conf;

}

 


o


Odoo Beratung Deutschland

Avatar
Verwerfen
Beste Antwort

Not sure if a solution was found but for me this config change worked

proxy_mode = True in the odoo.conf file. 

Avatar
Verwerfen
Autor Beste Antwort

the NGINX I'm is the NGINX proxy manager in a docker container such as shown (see above link).. It's not in such "config" file to post..

Avatar
Verwerfen

I just edited my original answer. Hope this helps you!