Created
March 10, 2015 20:49
-
-
Save cahlan/336007c62e6716b31a94 to your computer and use it in GitHub Desktop.
sample nginx for hosting multiple apps/domains on a single droplet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install nginx | |
# sudo apt-get install nginx | |
# configure nginx | |
# /etc/nginx/sites-available/[myconfigfile] | |
# create symlink /\ \/ | |
# /etc/nginx/sites-enabled/[myconfigfile] | |
server { | |
listen 80; | |
server_name awesome.com | |
location / { | |
proxy_pass http://127.0.0.1:8001/; | |
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; | |
} | |
} | |
server { | |
listen 80; | |
server_name radical.com | |
location / { | |
proxy_pass http://127.0.0.1:8002/; | |
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; | |
} | |
} | |
server { | |
listen 80; | |
server_name someapp.radical.com | |
location / { | |
proxy_pass http://127.0.0.1:8003/; | |
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cahlan, would you mind putting in a few notes in a readme file to help clarify what needs to change and what doesn't and where some of the information is coming from like the ip address (is it from the droplet or a random one that you can just make up)?