Created
March 11, 2013 22:01
-
-
Save hoffrocket/5138224 to your computer and use it in GitHub Desktop.
basic nginx proxy 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
user nginx nginx; | |
worker_processes 2; | |
pid /var/run/nginx.pid; | |
error_log /var/log/nginx/error_log info; | |
worker_rlimit_nofile 8192; | |
events { | |
worker_connections 8192; | |
use epoll; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
log_format main | |
'$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $bytes_sent ' | |
'"$http_referer" "$http_user_agent" ' | |
'"$gzip_ratio"'; | |
client_header_timeout 5s; | |
client_body_timeout 5s; | |
client_max_body_size 1m; | |
send_timeout 5s; | |
connection_pool_size 256; | |
client_header_buffer_size 1k; | |
large_client_header_buffers 4 2k; | |
request_pool_size 4k; | |
gzip on; | |
gzip_min_length 1100; | |
gzip_buffers 4 8k; | |
gzip_types text/plain application/xml application/x-javascript application/json; | |
output_buffers 1 32k; | |
postpone_output 1460; | |
charset utf-8; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 10; | |
ignore_invalid_headers on; | |
index index.html; | |
upstream fourstalgia { | |
server 127.0.0.1:9000; | |
server 127.0.0.1:9001; | |
} | |
server { | |
listen 443; | |
listen 80; | |
ssl on; | |
server_name fourstalgia.com; | |
access_log /var/log/nginx/fourstalgia.access_log main; | |
error_log /var/log/nginx/fourstalgia.error_log info; | |
root /var/www/fourstalgia; | |
ssl_certificate /etc/nginx/fourstalgia.crt; | |
ssl_certificate_key /etc/nginx/fourstalgia.key; | |
ssl_session_cache shared:SSL:2m; | |
ssl_session_timeout 1m; | |
ssl_protocols SSLv3 TLSv1; | |
ssl_ciphers FIPS; | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-Port $server_port; | |
proxy_redirect off; | |
proxy_next_upstream error timeout invalid_header http_500; | |
proxy_connect_timeout 1s; | |
proxy_pass http://fourstalgia; | |
proxy_send_timeout 5s; | |
proxy_buffering on; | |
} | |
rewrite ^/(.*)/favicon.ico$ /favicon.ico last; | |
location /favicon.ico { | |
access_log off; | |
log_not_found off; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment