Skip to content

Instantly share code, notes, and snippets.

@wgwz
Last active April 13, 2017 16:15
Show Gist options
  • Save wgwz/43907202127aff1502e30f30fb21f7b4 to your computer and use it in GitHub Desktop.
Save wgwz/43907202127aff1502e30f30fb21f7b4 to your computer and use it in GitHub Desktop.
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 - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 0;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
upstream backend {
server website:8000;
}
server {
listen 80;
charset utf-8;
location / {
# proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
# proxy_set_header X-Real-IP $remote_addr;
# nginx sse config
proxy_http_version 1.1;
proxy_set_header Connection "";
# chunked_transfer_encoding off;
proxy_buffering off;
proxy_pass_header X-Accel-Buffering;
# proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Host $server_name;
proxy_pass http://backend;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment