You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Create our Docker Container

Create a nginx reverse proxy by issuing the following command:

> docker run -d --net host --restart=always -p 80:80 --name proxy -v {CONFIG_DIR}:/etc/nginx/sites-enabled lerenn/nginx-reverse-proxy

This will create a reverse proxy running on the host network. We specify a CONFIG_DIR where we will add our site config files (see below).


Define our Nginx Configuration Files

In the config folder we defined in our docker command we will add a configuration like the following:

mysite.conf
server {
        listen       80;
        server_name  wiki wiki.jmehan.com;
        location / {
            proxy_pass         http://192.168.1.60:8090/;
            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;

            client_max_body_size       10m;
            client_body_buffer_size    128k;

            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;

            proxy_buffer_size          4k;
            proxy_buffers              4 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 64k;
        }
}
  • No labels