This Node.js Proxy allows your Medium page to have a custom domain.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Docker
- Have your domain setup to point to your server
- Let's Encrypt - If you want to use HTTPS
- If you want to run the service without Docker, you will need Node.js
- If you want to use a reverse-proxy, configure your Nginx or Apache to proxy requests to the port you will run this service on
You can either use the available image from dockerhub or build your own image by running docker build -t your-tag .
.
# Without HTTPS
docker run -d -p 3000:80 \
-e MEDIUM_URL=https://medium.com/ngoline \
-e SEARCH_USERNAME=ngoline \
-e PUBLIC_FOLDER=/var/www/your.domain \
-v /path/to/your/public/folder:/var/www/your.domain \
ngoline/medium-domain-proxy
#
# OR with HTTPS
docker run -d -p 3000:80 \
-p 3001:443 \
-e MEDIUM_URL=https://medium.com/ngoline \
-e SEARCH_USERNAME=ngoline \
-e PUBLIC_FOLDER=/var/www/your.domain \
-e HTTPS_PRIVATE_KEY=/etc/letsencrypt/live/your.domain/privkey.pem \
-e HTTPS_CERTIFICATE=/etc/letsencrypt/live/your.domain/fullchain.pem \
-v /path/to/your/public/folder:/var/www/your.domain \
-v /etc/letsencrypt/live/your.domain:/etc/letsencrypt/live/your.domain \
ngoline/medium-domain-proxy
Clone this repository to your server.
git clone https://github.com/ngoline/medium-domain-proxy && cd medium-domain-proxy
Install npm packages and build the project
npm i && npm run build
Run the proxy
# Set your variables in-line
MEDIUM_URL=https://medium.com/ngoline SEARCH_USERNAME=ngoline PUBLIC_FOLDER=/var/www/your.domain npm start
# Or set them as environment variables
export MEDIUM_URL=https://medium.com/ngoline
export SEARCH_USERNAME=ngoline
export PUBLIC_FOLDER=/var/www/your.domain
npm start
HTTP_PORT
- The port the proxy will listen on. eg. 80HTTPS_PORT
- The port the proxy will listen on for HTTPS requests. eg. 443MEDIUM_URL
- The URL of your Medium page. eg. https://medium.com/ngolineSEARCH_USERNAME
- Your Medium username. eg. ngolinePUBLIC_FOLDER
- The folder where your webserver will serve your files. eg. /var/www/your.domainPUBLIC_FILE_TYPES
- The file types that will be served from the public folder (csv). eg. html,css,js,png,jpg,jpeg,gif,svg,ico,woff,woff2,ttf,eot,otf,mp4,webm,ogg,mp3,wav,flac,aacHTTPS_PRIVATE_KEY
- The path to your private key file. eg. /etc/letsencrypt/live/your.domain/privkey.pemHTTPS_CERTIFICATE
- The path to your certificate file. eg. /etc/letsencrypt/live/your.domain/fullchain.pem
This project is licensed under the Apache 2.0 License - see LICENSE.md for details