Skip to content

Instantly share code, notes, and snippets.

@mostafahussein
Forked from dweldon/meteor-nginx
Created July 11, 2017 19:19
Show Gist options
  • Save mostafahussein/86233ec76ff3b7282ebb382302bbe681 to your computer and use it in GitHub Desktop.
Save mostafahussein/86233ec76ff3b7282ebb382302bbe681 to your computer and use it in GitHub Desktop.
This is an example of how to configure nginx to serve a meteor app.
server {
listen [::]:80;
listen 80;
server_name app.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen [::]:443 ssl http2;
listen 443 ssl http2;
server_name app.example.com;
ssl on;
ssl_certificate /etc/nginx/ssl/ssl.crt;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
location = /favicon.ico {
root /home/ubuntu/app/bundle/programs/web.browser/app;
access_log off;
expires 1w;
}
location ~* "^/[a-z0-9]{40}\.(css|js)$" {
root /home/ubuntu/app/bundle/programs/web.browser;
access_log off;
expires max;
}
location ~ "^/packages" {
root /home/ubuntu/app/bundle/programs/web.browser;
access_log off;
}
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment