Created
January 21, 2011 09:59
-
-
Save webgago/789490 to your computer and use it in GitHub Desktop.
Nginx config
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 www-data; | |
| worker_processes 2; | |
| error_log /var/log/nginx/error.log; | |
| pid /opt/nginx/logs/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| multi_accept on; | |
| use epoll; | |
| } | |
| http { | |
| passenger_root /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.0; | |
| passenger_ruby /usr/local/bin/ruby; | |
| # Passenger never sleeps! | |
| passenger_pool_idle_time 0; | |
| # Use more instances, because memory is enough | |
| passenger_max_pool_size 5; | |
| client_max_body_size 25m; | |
| gzip on; | |
| gzip_disable "msie6"; | |
| gzip_vary on; | |
| gzip_min_length 512; | |
| gzip_buffers 256 8k; | |
| gzip_comp_level 3; | |
| gzip_proxied any; | |
| gzip_types application/json text/plain text/css application/x-javascript application/xml application/xhtml+xml; | |
| server_tokens off; | |
| keepalive_timeout 35; | |
| include /etc/nginx/mime.types; | |
| access_log /var/log/nginx/access.log; | |
| reset_timedout_connection on; | |
| sendfile on; | |
| tcp_nopush on; | |
| tcp_nodelay on; | |
| proxy_buffering on; | |
| proxy_buffer_size 4k; | |
| proxy_buffers 20 256k; | |
| server { | |
| listen 80; | |
| server_name dev.raygroup.ru; | |
| location / { | |
| rewrite ^/(.*) https://$host/$1 permanent; | |
| } | |
| } | |
| server{ | |
| listen 443 ssl; | |
| server_name dev.raygroup.ru; | |
| rails_env production; | |
| passenger_min_instances 2; | |
| ssl on; | |
| ssl_certificate /opt/nginx/ssl/cert.pem; | |
| ssl_certificate_key /opt/nginx/ssl/cert.key; | |
| ssl_session_timeout 5m; | |
| ssl_protocols SSLv2 SSLv3 TLSv1; | |
| ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; | |
| ssl_prefer_server_ciphers on; | |
| location / { | |
| passenger_enabled on; | |
| } | |
| location ~* ^\/(stylesheets|system|images|img|javascripts).*\.(jpg|jpeg|gif|css|js|png|)$ { | |
| root /home/deploy/idealjob.ru/current/public; | |
| #access_log off; | |
| expires 30d; | |
| } | |
| root /home/deploy/idealjob.ru/current/public; | |
| auth_basic "Login"; | |
| auth_basic_user_file /home/deploy/idealjob.ru/shared/.htpasswd; | |
| } | |
| server{ | |
| listen 80; | |
| server_name ci.raygroup.ru; | |
| ssl off; | |
| location / { | |
| proxy_set_header X-Real-IP 127.0.0.1; | |
| proxy_set_header REMOTE_ADDR 127.0.0.1; | |
| proxy_pass http://localhost:8111; | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment