Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Add X-Real-IP and X-Forwarded-For headers using the proxy_set_header instruction by adding it to the /etc/nginx/conf.d/proxy.conf file.

Code Block
server {
  proxy_redirect  server_name  creativeattitude.com www.creativeattitude.com;
    location / {
            proxy_passoff;
proxy_set_header         http://192.168.1.50:7082/;
    }

Host       listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/www.creativeattitude.com-0002/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/www.creativeattitude.com-0002/privkey.pem; # managed by Certbot
    proxy_set_header$host;
proxy_set_header        X-Real-IP        $remote_addr;
    proxy_set_header        X-Forwarded-For  $proxy_add_x_forwarded_for;

}
server {
    listenclient_max_body_size    10m;
client_body_buffer_size 500m;
client_header_buffer_size 500m;
proxy_connect_timeout   90;
proxy_send_timeout      90;
proxy_read_timeout  80;
    server_name90;
proxy_buffer_size  creativeattitude.com www.creativeattitude.com;
 16k;
proxy_buffers       32 return 301 https://www.creativeattitude.com$request_uri;
} 16k;
proxy_busy_buffers_size 64k;


Customized Dockerfile

The following Dockerfile adds certbot and apache2-utils to our nginx-reverse-proxy image.

...