Last active
August 29, 2015 14:04
-
-
Save yauh/59c0ec27f5e167e04c17 to your computer and use it in GitHub Desktop.
Nginx site configuration
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
upstream meteor_servers { | |
server 192.168.2.221:3000; | |
server 192.168.2.222:3000; | |
ip_hash; | |
} | |
server { | |
listen 80; | |
server_name meteorinaction.com; | |
return 301 https://www.meteorinaction.com$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
ssl_certificate /path/to/my.crt; | |
ssl_certificate_key /path/to/my.key; | |
ssl_protocols SSLv3 TLSv1; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
server_name www.meteorinaction.com default; | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_comp_level 6; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
location ~ \.(jpg|jpeg|png|gif|mp3|ico|pdf) { | |
root /home/meteor/app/bundle/programs/client/app; | |
access_log off; | |
expires max; | |
} | |
location ~* "^/[a-z0-9]{40}\.(css|js)$" { | |
root /home/meteor/app/bundle/programs/client; | |
access_log off; | |
expires max; | |
} | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://meteor_servers; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment