Created
December 10, 2014 18:17
-
-
Save baskaran-md/d406ec98ffc2c07316da to your computer and use it in GitHub Desktop.
nginx.conf - SSL Target
This file contains 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 nobody; | |
worker_processes 8; | |
worker_rlimit_nofile 100000; | |
events { | |
worker_connections 4000; | |
# optmized to serve many clients with each thread, essential for linux | |
use epoll; | |
# accept as many connections as possible, may flood worker connections if set too low | |
multi_accept on; | |
} | |
error_log logs/error.log crit; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
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"'; | |
#access_log logs/access.log main; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
keepalive_requests 100000; | |
#gzip on; | |
# allow the server to close connection on non responding client, this will free up memory | |
reset_timedout_connection on; | |
# request timed out -- default 60 | |
client_body_timeout 10; | |
# if client stop responding, free up memory -- default 60 | |
send_timeout 2; | |
# reduce the data that needs to be sent over network | |
gzip on; | |
gzip_min_length 10240; | |
gzip_proxied expired no-cache no-store private auth; | |
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; | |
gzip_disable "MSIE [1-6]\."; | |
server { | |
listen 80; | |
server_name localhost; | |
root html; | |
#charset koi8-r; | |
access_log off; | |
#access_log logs/host.access.log main; | |
location / { | |
root html; | |
index index.html index.htm; | |
} | |
#error_page 404 /404.html; | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
location = /2.0/services_200 { | |
keepalive_timeout 0; | |
} | |
location = /2.0/services { | |
keepalive_timeout 60; | |
proxy_set_header Connection1 "keep-alive"; | |
return 500; | |
} | |
location = /2.0/services_300 { | |
return 302; | |
} | |
location = /2.0/services_100 { | |
return 101; | |
} | |
location = /2.0/services_401 { | |
return 401; | |
} | |
location = /2.0/services_400 { | |
return 400; | |
} | |
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 | |
# | |
#location ~ \.php$ { | |
# proxy_pass http://127.0.0.1; | |
#} | |
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | |
# | |
#location ~ \.php$ { | |
# root html; | |
# fastcgi_pass 127.0.0.1:9000; | |
# fastcgi_index index.php; | |
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; | |
# include fastcgi_params; | |
#} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
#location ~ /\.ht { | |
# deny all; | |
#} | |
} | |
# another virtual host using mix of IP-, name-, and port-based configuration | |
# | |
#server { | |
# listen 8000; | |
# listen somename:8080; | |
# server_name somename alias another.alias; | |
# location / { | |
# root html; | |
# index index.html index.htm; | |
# } | |
#} | |
# HTTPS server | |
# | |
server { | |
listen 443 ssl; | |
server_name localhost; | |
client_body_buffer_size 10K; | |
client_header_buffer_size 1k; | |
client_max_body_size 8m; | |
large_client_header_buffers 2 1k; | |
client_body_timeout 12; | |
client_header_timeout 12; | |
keepalive_timeout 15; | |
send_timeout 10; | |
open_file_cache_valid 30s; | |
open_file_cache_min_uses 2; | |
open_file_cache_errors on; | |
#charset koi8-r; | |
access_log off; | |
#root /apigee/nginx-1.7.7/html; | |
ssl_certificate bobcert.pem; | |
ssl_certificate_key bobkey.pem; | |
ssl_session_cache shared:SSL:1m; | |
ssl_session_timeout 5m; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
ssl_prefer_server_ciphers on; | |
#Enable to turn on client validation | |
#ssl_verify_client on; | |
#ssl_client_certificate client.pem; | |
location / { | |
root html; | |
index index.html index.htm; | |
} | |
location = /2.0/services_200 { | |
keepalive_timeout 0; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /2.0/services { | |
return 500; | |
} | |
location = /2.0/services_300 { | |
return 302; | |
} | |
location = /2.0/services_100 { | |
return 101; | |
} | |
location = /2.0/services_401 { | |
return 401; | |
} | |
location = /2.0/services_400 { | |
return 400; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment