Created
March 8, 2014 02:44
-
-
Save stephentcannon/9424522 to your computer and use it in GitHub Desktop.
Meteor nginx conf
This file contains 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
server { | |
listen 80 default_server; | |
server_name _; | |
# could be 301 if you want | |
return 302 https://$host$request_uri; | |
} | |
server { | |
listen 80; | |
server_name *.yourdomain.com; | |
# use 301 for permanent in production | |
return 302 https://$host$request_uri; | |
} | |
server { | |
listen 443; | |
server_name *.yourdomain.com; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/ssl.crt; | |
ssl_certificate_key /etc/nginx/ssl/ssl.key; | |
location = /favicon.ico { | |
root /opt/meteor/app/programs/client/app; | |
access_log off; | |
expires 1w; | |
} | |
location ~* "^/[a-z0-9]{40}\.(css|js)$" { | |
root /opt/meteor/app/programs/client; | |
access_log off; | |
expires max; | |
} | |
location ~ "^/packages" { | |
root /opt/meteor/app/programs/client; | |
access_log off; | |
} | |
location / { | |
proxy_pass http://localhost:58080; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment