File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ ENV DOMAIN_NAME=false
99ENV USER_EMAIL=false
1010ENV CONFIG=/etc/nginx/conf.d/OpenSpeedTest-Server.conf
1111
12+ ENV CHANGE_CONTAINER_PORTS=false
13+ ENV HTTP_PORT=3000
14+ ENV HTTPS_PORT=3001
15+ ENV SET_USER=101
16+
1217COPY /files/OpenSpeedTest-Server.conf ${CONFIG}
1318COPY /files/entrypoint.sh /entrypoint.sh
1419COPY /files/renew.sh /renew.sh
@@ -62,11 +67,10 @@ RUN chown nginx:nginx /usr/sbin/crond \
6267RUN touch /etc/crontabs/nginx
6368RUN chown -R nginx:nginx /etc/crontabs/nginx
6469
65- USER 101
70+ USER ${SET_USER}
6671
67- EXPOSE 3000 3001
72+ EXPOSE ${HTTP_PORT} ${HTTPS_PORT}
6873
6974STOPSIGNAL SIGQUIT
7075
71- CMD ["/entrypoint.sh" ]
72-
76+ CMD ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -118,3 +118,23 @@ services:
118118 - '3001:3001'
119119 image: openspeedtest/latest
120120````
121+ ## Advanced Configuration Options
122+
123+ - Container Port Configuration
124+
125+ To enable port changes, set the ` CHANGE_CONTAINER_PORTS ` environment variable to ` "True" ` and provide appropriate values for the following variables.
126+
127+ ` CHANGE_CONTAINER_PORTS=True `
128+
129+ ` HTTP_PORT=3000 `
130+
131+ ` HTTPS_PORT=3001 `
132+
133+ - Set User
134+
135+ ` SET_USER=101 `
136+
137+ - Only Allow ` CORS Request ` from listed domains.
138+
139+ ` ALLOW_ONLY=domain1.com;domain2.com;domain3.com `
140+
Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ server_name _ localhost YOURDOMAIN;
1717 # Nginx Server Windows SSL Performance was very poor! Better use Linux if you need SSL support.
1818 ssl_certificate /etc/ssl/nginx.crt; # Use your own certificate & key
1919 ssl_certificate_key /etc/ssl/nginx.key; # <-- key
20- ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
21- ssl_protocols TLSv1.1 TLSv1.2;
22- ssl_session_cache shared:SSL:10m;
23- ssl_session_timeout 10m;
20+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
21+ ssl_ciphers "ALL";
22+ ssl_prefer_server_ciphers on;
23+ ssl_session_cache shared:SSL:100m;
24+ ssl_session_timeout 1d;
25+ ssl_session_tickets on;
2426 root /usr/share/nginx/html/;
2527 index index.html;
2628 client_max_body_size 35m;
Original file line number Diff line number Diff line change @@ -12,6 +12,30 @@ if [[ $? -ne 0 ]]; then
1212 sed -i ' /listen 300/d' ${CONFIG}
1313fi
1414
15+
16+ if [ " $CHANGE_CONTAINER_PORTS " = True ]; then
17+ if [ " $HTTP_PORT " ]; then
18+ sed -i " s/3000/${HTTP_PORT} /g" ${CONFIG}
19+ if [ $? -eq 0 ]; then
20+ echo " Changed HTTP container port to " ${HTTP_PORT}
21+ else
22+ echo " Failed to change HTTP container port to " ${HTTP_PORT}
23+ fi
24+
25+ fi
26+
27+ if [ " $HTTPS_PORT " ]; then
28+ sed -i " s/3001/${HTTPS_PORT} /g" ${CONFIG}
29+ if [ $? -eq 0 ]; then
30+ echo " Changed HTTPS container port to " ${HTTPS_PORT}
31+ else
32+ echo " Failed to change HTTPS container port to " ${HTTPS_PORT}
33+ fi
34+
35+ fi
36+ fi
37+
38+
1539Verify_TXT_path=" /usr/share/nginx/html/Verify.txt"
1640
1741if [ " $VERIFY_OWNERSHIP " ]; then
You can’t perform that action at this time.
0 commit comments