Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4294 Tampilan

I have an odoo 15 installation behind a Nginx proxy. I want to activate the SSL certificate with "cerbot"

Aug 16 12:28:07 vmi947915.contaboserver.net nginx[15998]: nginx: [emerg] "location" directive is not allowed here in /etc/nginx/sites-enabled/uwuthis.one:60


# Odoo server


upstream odooserver {


server 127.0.0.1:8069;

}

upstream odoochat {

server 127.0.0.1:8072;

}


#HTTP -> HTTPS

server {

listen [::]:80;

listen 80;

server_name uwuthis.one;

return 301 https://uwuthis.one$request_uri;

}


# WWW -> NON

server {

listen [::]:443 ssl;

listen 443 ssl http2;

server_name uwuthis.one;

ssl_certificate /etc/letsencrypt/live/uwuthis.one/fullchain.pem;


ssl_certificate_key /etc/letsencrypt/live/uwuthis.one/privkey.pem;


ssl_trusted_certificate /etc/letsencrypt/live/uwuthis.one/chain.pem;


include snippets/ssl.conf;


include snippets/letsencrypt.conf;


return 301 https://uwuthis.one$request_uri;

}


server {

listen 443 ssl http2;

server_name uwuthis.one;

proxy_read_timeout 720s;

proxy_connect_timeout 720s;

proxy_send_timeout 720s;


#Proxy headers

proxy_set_header X-Forwarded-Host $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;


#SSL parameters

ssl_certificate /etc/letsencrypt/live/uwuthis.one/fullchain.pem;

ssl_certificate_key /etc/letsencrypt/live/uwuthis.one/privkey.pem;

ssl_trusted_certificate /etc/letsencrypt/live/uwuthis.one/chain.pem;

include snippets/ssl.conf;

include snippets/letsencrypt.conf;

}


#log files

access_log /var/log/nginx/odoo.access.log;

error_log /var/log/nginx/odoo.error.log;


# Specifies the maximum accepted body size of a client request,

# as indicated by the request header Content-Length.


client_max_body_size 200m;


# increase proxy buffer to handle some odoo web requests

proxy_buffers 16 64k;

proxy_buffer_size 128k;


# Redirect longpoll requests to odoo longpolling port

  location /longpolling {

    proxy_pass http://odoochat;

  }


  # Redirect requests to odoo backend server

  location / {

    proxy_redirect off;

    proxy_pass http://odoo;

  }


# Cache static files

location ~* /web/static/ {

proxy_cache_valid 200 90m;

proxy_buffering on;

expires 864000;

proxy_pass http://odooserver;

}


# Gzip

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

gzip on;

}

Avatar
Buang
Jawaban Terbai

Hi,

Please go through my forum answer.

Question : https://www.odoo.com/forum/help-1/ssl-configuration-nginx-error-208409

Answer : The location directive should be in the server directive, which in turn should be in the http directive.


http {

    server {

        location /some-path {

            proxy_pass             http://1.2.3.4;

        }

    }

}


Hope it helps

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Apr 24
7062
1
Agu 23
1605
3
Mei 24
5974
5
Nov 23
8295
1
Feb 23
1766