profile image
by elventails
on 7/11/14


## /etc/nginx/sites-enabled/nextly
####################################

server {
listen 80 default;
server_name shalaby.nextly.com ;
server_name_in_redirect off;
root /usr/local/marginize/mshalaby-nextly/current/public;
passenger_enabled on;
passenger_min_instances 4;
rails_env production;
rewrite ^/newadmin.*$ https://shalaby.nextly.com$request_uri? permanent;

location ~ ^/(assets|images|javascripts|stylesheets)/ {
gzip_static on;
expires max;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}


location = /favicon.ico {
expires max;
add_header Cache-Control public;
}
}

server {
listen 443;
root /usr/local/marginize/mshalaby-nextly/current/public;
passenger_enabled on;
#passenger_min_instances 2;

rails_env production;
ssl on;
ssl_certificate /etc/nginx/ssl/nextly.com.crt;
ssl_certificate_key /etc/nginx/ssl/nextly.com.key.nopass;
}




## /etc/nginx/nginx.conf
######################################





user mshalaby;
worker_processes 1;

worker_rlimit_nofile 65536;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 32768;
}


http {
#passenger_root /home/mshalaby/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/passenger-4.0.5;
#passenger_ruby /home/mshalaby/.rvm/wrappers/ruby-1.9.3-p392-railsexpress/ruby;

#passenger_root /home/mshalaby/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.53;
#passenger_ruby /home/mshalaby/.rvm/gems/ruby-2.0.0-p353/wrappers/ruby;

passenger_root /home/mshalaby/.rvm/gems/ruby-2.1.4/gems/passenger-4.0.53;
passenger_ruby /home/mshalaby/.rvm/gems/ruby-2.1.4/wrappers/ruby;

passenger_friendly_error_pages off;
## passenger_max_pool_size 162;
passenger_max_pool_size 38;


#passenger_use_global_queue off;

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"';

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

include sites-enabled/*;

passenger_pre_start http://shalaby.nextly.com;
}