Skip to content

Instantly share code, notes, and snippets.

@windwiny
Created November 15, 2013 06:43
Show Gist options
  • Save windwiny/7480143 to your computer and use it in GitHub Desktop.
Save windwiny/7480143 to your computer and use it in GitHub Desktop.
nginx config
### included
upstream app1.com {
server 127.0.0.1:3001;
# server 127.0.0.1:3002;
# server 127.0.0.1:3003;
# server 127.0.0.1:3004;
# server 127.0.0.1:3005;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
access_log e:/lamp/app1.com/logs/access.log;
error_log e:/lamp/app1.com/logs/error.log;
root e:/lamp/app1.com/;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
try_files maintenance.html $uri $uri/index.html $uri.html @ruby;
}
location @ruby {
proxy_pass http://app1.com;
}
}
server {
listen 443;
server_name localhost;
access_log e:/lamp/app1.com/logs/access2.log;
error_log e:/lamp/app1.com/logs/error2.log;
root e:/lamp/app1.com/;
index index.html;
ssl on;
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root shtml;
index sindex.html sindex.htm;
try_files maintenance.html $uri $uri/index.html $uri.html @ruby;
}
location @ruby {
proxy_pass http://app1.com;
}
}
##### ------------ main
worker_processes 1;
error_log e:/lamp/nginx/logs/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
#include e:/lamp/nginx/sites_enabled/*.txt;
include e:/lamp/app1.com/app1.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment