NGiNX Reverse proxy Dockerfile

MD
S
Markdown

Simple Dockerfile for an NGiNX Reverse proxy. This example is based on Intercom. https://www.nginx.com/resources/wiki/start/topics/examples/full/

1# Dockerfile
2FROM nginx
3COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
4EXPOSE 8080
5
6# nginx.conf
7server {
8    listen 8080;
9    server_name help.coderecipes.org;
10    location / {
11        proxy_set_header Host $host;
12        proxy_pass https://custom.intercom.help;
13    }
14}
15
16# scripts.sh
17#!bin/sh
18docker build -t help .
19docker run -d -p 80:8080 --name="nginx-help" help
20docker logs nginx-help
21

Created on 3/2/2018