Created
January 24, 2012 14:27
-
-
Save thilo/1670428 to your computer and use it in GitHub Desktop.
ngix ssl proxy 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 nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /usr/local/etc/nginx/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 off; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 60; | |
keepalive_requests 100; | |
ignore_invalid_headers on; | |
index index.html; | |
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; | |
client_max_body_size 5m; | |
client_body_buffer_size 128k; | |
proxy_connect_timeout 75; | |
proxy_send_timeout 60; | |
proxy_read_timeout 60; | |
proxy_buffers 32 4k; | |
proxy_buffering on; | |
proxy_ignore_client_abort on; | |
proxy_next_upstream error timeout invalid_header http_500 http_503; | |
#gzip on; | |
server { | |
listen 443 ssl; | |
server_name .cobot.dev; | |
ssl on; | |
ssl_certificate cobot_dev.cert; | |
ssl_certificate_key cobot_dev.key; | |
keepalive_timeout 60; | |
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 / { | |
proxy_pass http://cobot.dev:80; | |
### force timeouts if one of backend is died ## | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; | |
### Set headers #### | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
### Most PHP, Python, Rails, Java App can use this header ### | |
proxy_set_header X-Forwarded-Proto https; | |
### By default we don't want to redirect it #### | |
proxy_redirect off; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment