Difference between revisions of "IT-SDK-Webserver"

From wiki.samerhijazi.net
Jump to navigation Jump to search
(nginx)
(nginx)
Line 1: Line 1:
 +
=Source=
 +
* https://stackoverflow.com/questions/55270099/how-do-i-build-a-custom-nginxalpine-based-container-listening-on-port-other-tha
 +
* https://www.katacoda.com/courses/docker/create-nginx-static-web-server
 +
* http://nginx.org/en/docs/beginners_guide.html
 
=nginx=
 
=nginx=
* source: http://nginx.org/en/docs/beginners_guide.html
+
* cfg-Base: /usr/share/nginx/html
* cfg Name: /etc/nginx/nginx.conf
+
* cfg-File: /etc/nginx/nginx.conf
* cfg Blocks: http, server, location
+
* cfg-File: /etc/nginx/conf.d/default.conf
 +
* cfg-Blocks: http, server, location
 
* cfg Location: /usr/local/nginx/conf, /usr/local/etc/nginx or '''/etc/nginx'''.
 
* cfg Location: /usr/local/nginx/conf, /usr/local/etc/nginx or '''/etc/nginx'''.
 
* control: nginx -s signal. Where signal may be the following: stop, quit, reload, reopen
 
* control: nginx -s signal. Where signal may be the following: stop, quit, reload, reopen
Line 8: Line 13:
 
* List: ps -ax | grep nginx
 
* List: ps -ax | grep nginx
 
* List content of Directory: autoindex=on;
 
* List content of Directory: autoindex=on;
 +
<pre class="code">
 +
nano Dockerfile
 +
-------------------------------------
 +
FROM nginx:alpine
 +
COPY . /usr/share/nginx/html
 +
-------------------------------------
 +
docker build -t webserver-image:v1 .
 +
docker run -d -p 80:80 webserver-image:v1
 +
curl localhost:80
 +
</pre>

Revision as of 14:34, 5 January 2021

Source

nginx

  • cfg-Base: /usr/share/nginx/html
  • cfg-File: /etc/nginx/nginx.conf
  • cfg-File: /etc/nginx/conf.d/default.conf
  • cfg-Blocks: http, server, location
  • cfg Location: /usr/local/nginx/conf, /usr/local/etc/nginx or /etc/nginx.
  • control: nginx -s signal. Where signal may be the following: stop, quit, reload, reopen
  • KILL: kill -s QUIT 1628
  • List: ps -ax | grep nginx
  • List content of Directory: autoindex=on;
nano Dockerfile
-------------------------------------
FROM nginx:alpine
COPY . /usr/share/nginx/html
-------------------------------------
docker build -t webserver-image:v1 .
docker run -d -p 80:80 webserver-image:v1
curl localhost:80