Skip to content

Node.js API for NGINX server (create/delete server configuration file)

Notifications You must be signed in to change notification settings

NachoColl/landingpage.services.nginx.api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#NGINX node.js API

Node.js API to create/delete NGINX server configuration files.

Used from https://landingpage.services to add custom domains support.

##How I use it

When I need landingpage.services to catch a new domain, I call the node.js API endpoint api/cname indicating the domain and the real page location. The node.js server then calls a bash script that creates the new NGINX configuration file.

NGINX server configuration file example:

server {
	listen   80;
      
  server_name www.trackphone.us;
      
	location = / {
		rewrite ^.* /gps-tracking-app.html; 
	}
      
	location / {
    proxy_pass https://s3-us-west-2.amazonaws.com/files.landingpage.services/us-west-2:1234sb-4f84-432b-96d7-7f54gdaa034/;
   }
}

The project is also available at cloud9 https://c9.io/nachocoll/landingpage-services-nginx-api/

About

Node.js API for NGINX server (create/delete server configuration file)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published