File tree 3 files changed +52
-0
lines changed
3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM nginx
2
+
3
+ ENV SOCKET_SERVER socket_server
4
+ COPY nginx.conf /etc/nginx/nginx.conf
5
+ COPY run.sh /
6
+
7
+ CMD ["bash" , "/run.sh" ]
Original file line number Diff line number Diff line change
1
+ user nginx;
2
+ worker_processes 1 ;
3
+ daemon off ;
4
+
5
+ error_log stderr warn ;
6
+ pid /var/run/nginx.pid;
7
+
8
+ events {
9
+ worker_connections 1024 ;
10
+ }
11
+
12
+ http {
13
+ include /etc/nginx/mime.types;
14
+ default_type application/octet-stream;
15
+
16
+ log_format elb_log '$proxy_protocol_addr - $remote_user [$time_local ] '
17
+ '"$request " $status $body_bytes_sent "$http_referer " '
18
+ '"$http_user_agent "' ;
19
+
20
+ access_log /dev/stdout elb_log;
21
+
22
+ server {
23
+ listen 80 ;
24
+ proxy_http_version 1.1 ;
25
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
26
+ proxy_set_header X-Forwarded-Proto $scheme ;
27
+ proxy_set_header X-Real-IP $remote_addr ;
28
+ proxy_set_header Host $host ;
29
+
30
+ location / {
31
+ proxy_pass http://SOCKET_SERVER;
32
+ proxy_set_header Upgrade $http_upgrade ;
33
+ proxy_set_header Connection "upgrade" ;
34
+ proxy_cache_bypass $http_upgrade ;
35
+ }
36
+ }
37
+
38
+ sendfile on ;
39
+ keepalive_timeout 65 ;
40
+ include /etc/nginx/conf.d/*.conf;
41
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ sed -i " s/SOCKET_SERVER/${SOCKET_SERVER} /g" /etc/nginx/nginx.conf
4
+ nginx
You can’t perform that action at this time.
0 commit comments