This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} | ||
} |