Skip to content

Instantly share code, notes, and snippets.

@jacksonpires
Created May 8, 2018 01:25
Show Gist options
  • Save jacksonpires/1b688a57fee2eac8c1a9d26d7e4f0ec9 to your computer and use it in GitHub Desktop.
Save jacksonpires/1b688a57fee2eac8c1a9d26d7e4f0ec9 to your computer and use it in GitHub Desktop.
Configuração para aplicação Node.JS do curso de Docker
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;
upstream app {
server minha_app:3090;
}
server {
listen 80;
proxy_buffers 64 16k;
proxy_max_temp_file_size 1024m;
proxy_connect_timeout 5s;
proxy_send_timeout 10s;
proxy_read_timeout 10s;
location / {
try_files $uri $uri/ @nginx_nodejs_app;
}
location @nginx_nodejs_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app;
}
}
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment