Skip to content

Instantly share code, notes, and snippets.

@kkxlkkxllb
Created August 14, 2013 06:56
Show Gist options
  • Select an option

  • Save kkxlkkxllb/6228610 to your computer and use it in GitHub Desktop.

Select an option

Save kkxlkkxllb/6228610 to your computer and use it in GitHub Desktop.
upstream imc_backend {
server unix:/data/app/imc/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 8081;
server_name imc.unionpaysmart.com;
access_log /var/log/nginx/imc-uionpaysmart-com-access.log main;
error_log /var/log/nginx/imc-unionpaysmart-com-error.log;
location / {
proxy_redirect off;
#proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:$server_port;
proxy_ignore_client_abort on;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_connect_timeout 300;
#fastcgi_send_timeout 300;
#fastcgi_connect_timeout 300;
#fastcgi_read_timeout 300;
if (!-f $request_filename) {
proxy_pass http://imc_backend;
break;
}
}
location ~ /\.ht {
deny all;
}
location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|mid|midi|wav|bmp|rtf)$ {
root /data/app/imc/current/public;
expires 30d;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment