-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM nginx | ||
|
||
ENV SOCKET_SERVER socket_server | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY run.sh / | ||
|
||
CMD ["bash", "/run.sh"] |
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,41 @@ | ||
user nginx; | ||
worker_processes 1; | ||
daemon off; | ||
|
||
error_log stderr warn; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format elb_log '$proxy_protocol_addr - $remote_user [$time_local] ' | ||
'"$request" $status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent"'; | ||
|
||
access_log /dev/stdout elb_log; | ||
|
||
server { | ||
listen 80; | ||
proxy_http_version 1.1; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Host $host; | ||
|
||
location / { | ||
proxy_pass http://SOCKET_SERVER; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
} | ||
|
||
sendfile on; | ||
keepalive_timeout 65; | ||
include /etc/nginx/conf.d/*.conf; | ||
} |
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,4 @@ | ||
#!/bin/bash | ||
|
||
sed -i "s/SOCKET_SERVER/${SOCKET_SERVER}/g" /etc/nginx/nginx.conf | ||
nginx |