Permalink
Browse files

Add nginx conf template

Want the server to respond to all the http traffic.

From: http://dokku.viewdocs.io/dokku/configuration/nginx/
Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
  • Loading branch information...
scanf committed Mar 22, 2017
1 parent 379e358 commit 652225ab307439da71bb1081cfead51144c71dcc
Showing with 37 additions and 0 deletions.
  1. +1 −0 Dockerfile
  2. +36 −0 nginx.conf.sigil
View
@@ -56,6 +56,7 @@ RUN make -C $NETFILTER_DIR/iptables install
USER $WEB_USER
# Copy required source
ADD CHECKS /app/CHECKS
COPY nginx.conf.sigil $APP_DIR/nginx.conf.sigil
COPY package.json $APP_DIR/package.json
COPY index.js $APP_DIR/index.js
COPY public $APP_DIR/public
View
@@ -0,0 +1,36 @@
server {
listen 80;
listen 3000;
server_name {{ .NOSSL_SERVER_NAME }};
access_log /var/log/nginx/{{ .APP }}-access.log;
error_log /var/log/nginx/{{ .APP }}-error.log;
# set a custom header for requests
add_header X-Served-By www-ec2-01;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
gzip_vary on;
gzip_comp_level 6;
location / {
proxy_pass http://{{ .APP }};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
}
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
}
upstream {{ .APP }} {
{{ range .DOKKU_APP_LISTENERS | split " " }}
server {{ . }};
{{ end }}
}

0 comments on commit 652225a

Please sign in to comment.