Last active
February 18, 2016 02:39
-
-
Save BarronKane/b855d756fb7bee049378 to your computer and use it in GitHub Desktop.
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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
# max_clients = worker_processes * worker_connections / 4 | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
# backend applications | |
upstream nodes { | |
server 127.0.0.1:8000; | |
server 127.0.0.1:8001; | |
server 127.0.0.1:8002; | |
server 127.0.0.1:8003; | |
keepalive 64; | |
} | |
# rediect HTTP to HTTPS | |
server { | |
listen 80; | |
server_name bleuengine.com; | |
# rewrite ^ https://$server_name$request_uri? permanent; | |
} | |
server { | |
# listen 443 ssl; | |
# ssl_certificate /path/to/your/cert.file; | |
# ssl_certificate_key /path/to/your/cert.key; | |
# ssl_protocols SSLv3 TLSv1; | |
# ssl_ciphers HIGH:!aNULL:!MD5; | |
server_name bleuengine.com; | |
# static resources | |
location ~ ^/(robots.txt|humans.txt|favicon.ico) { | |
root /usr/share/nginx/html; | |
access_log off; | |
expires max; | |
} | |
# everything else goes to backend node apps | |
location / { | |
proxy_pass http://nodes; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_set_header Connection ""; | |
proxy_http_version 1.1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment