Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
Add nginx conf template
Browse files Browse the repository at this point in the history
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
aalemayhu committed Mar 22, 2017
1 parent 379e358 commit 652225a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions nginx.conf.sigil
@@ -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.