V
V
VN2021-01-27 16:49:03
Nginx
VN, 2021-01-27 16:49:03

How to set up a reverse proxy for a host with https?

There is a mail server which was published in the Internet. For technical reasons, ports 443 and 80 need to be removed behind nginx. Lets encrypt certificates are configured on the server, which are used not only for web ports, but also for postfix and dovecot.

Unfortunately this config doesn't work.

server {
    listen 80;
    server_name mail.domain.com;

    access_log /var/log/nginx/mail.domain.com-access.log;
    error_log /var/log/nginx/mail.domain.com-error.log;


    location / {
        proxy_pass http://192.168.9.100;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

Tell me, who faced a similar problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question