user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr $host $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent"';
log_format dev '$request_method $host$request_uri $status $request_time s - $body_bytes_sent';
gzip on;
sendfile on;
keepalive_timeout 65;
access_log /var/log/nginx/access.log dev;
real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;
client_max_body_size 51m;
# Include all of the virtual host configs
include /etc/nginx/conf.d/*.conf;
# Terminate all incoming SSL and proxy it to the underlying applications
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/ssl_cert.pem;
ssl_certificate_key /etc/ssl/ssl_cert.key;
# Disable the access log for SSL termination. It's useless clutter.
access_log off;
log_not_found off;
proxy_buffers 16 16k;
location / {
proxy_pass http://webserver;
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 X-Forwarded-Proto $scheme;
# For slow applicaitons / Shady could remove it if he wants
proxy_read_timeout 3600s;
proxy_send_timeout 300s;
}
}
}
|