Skip to content

Instantly share code, notes, and snippets.

@digilord
Created January 1, 2014 17:41
Show Gist options
  • Select an option

  • Save digilord/8209867 to your computer and use it in GitHub Desktop.

Select an option

Save digilord/8209867 to your computer and use it in GitHub Desktop.
Meteor Nginx configuration with SSL
server {
listen 80;
server_name www.example.com;
# $scheme will get the http protocol
# and 301 is best practice for tablet, phone, desktop and seo
# return 301 $scheme://example.com$request_uri;
# We want to redirect people to the https site when they come to the http site.
return 301 https://example.com$request_uri;
}
server {
listen 80;
server_name example.com;
# $scheme will get the http protocol
# and 301 is best practice for tablet, phone, desktop and seo
# return 301 $scheme://example.com$request_uri;
# We want to redirect people to the https site when they come to the http site.
return 301 https://example.com$request_uri;
}
server {
listen 443;
server_name example.com;
client_max_body_size 500M;
access_log /var/log/nginx/meteorapp.access.log;
error_log /var/log/nginx/meteorapp.error.log;
location / {
proxy_pass http://localhost:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
ssl on;
ssl_certificate /etc/nginx/ssl/star.example.com.pem;
ssl_certificate_key /etc/nginx/ssl/wildcard.key;
ssl_verify_depth 3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment