Skip to content

Instantly share code, notes, and snippets.

@thinklinux
Created June 30, 2015 14:36
Show Gist options
  • Save thinklinux/752ab72ecc36e6479466 to your computer and use it in GitHub Desktop.
Save thinklinux/752ab72ecc36e6479466 to your computer and use it in GitHub Desktop.
nginx and meteor-up config for multiple meteor apps on digital ocean with SSL
...
"ssl": {
"pem": "./ssl.pem",
// When the ssl terminator finish its job it will redirect the request to 8080
// where our nginx will listen and proxy the request to our meteor app on port 3002 for example
// meteor-up uses stud for ssl temination so nginx will not deal with ssl at all
"backendPort": 8080
}
...
server {
listen 80;
server_name www.yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
server {
listen 80;
server_name yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
server {
listen 8080;
server_name yourdomain.com;
location / {
proxy_pass http://yourdomain.com:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
# another meteor app on the same server on different port
server {
listen 8080;
server_name bla.yourdomain.com;
location / {
proxy_pass http://bla.yourdomain.com:3003;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment