Skip to content

Instantly share code, notes, and snippets.

@azeemh
azeemh / nginxproxy.md
Created June 29, 2017 15:26 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@azeemh
azeemh / nginx.md
Last active June 29, 2017 19:13
Simple Deployment of App to Proxy with Nginx & Ubuntu 16.04 (Rails, Sinatra, PHP, etc)

This tutorial can be used for any application that runs a server on localhost:port, in this case localhost:3000. i.e. rails s, any sinatra or nodejs server bound to a port, and even php -S localhost:3000...

INSTALL NGINX

purges any old versions

sudo apt-get purge nginx*

install clean nginx

@przbadu
przbadu / _vue-rails.md
Last active July 16, 2022 21:48
Vue js and Rails integration

Setup Rails and Vuejs

  1. Generate new rails app using --webpack flag
rails new myApp --webpack=vue

Note:

  1. You can use --webpack=angular for angular application and --webpack=react for react.
@azeemh
azeemh / barter.sh
Last active September 12, 2018 01:42
Barter Generator Script (rails 5.2+)
#!/bin/bash
cd
rails new barter --database=postgresql
cd barter
rails db:drop
rails db:create
rails db:migrate
###setup home controller