Last active
January 27, 2021 00:29
-
-
Save mariotpc/098a4a0cc194c660cfdb55535ed931bf to your computer and use it in GitHub Desktop.
my NGINX conf - taken from Alpine Linux site
This file contains hidden or 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
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig | |
vi /etc/nginx/nginx.conf | |
##################### CONF ############################# | |
alpine:/home/mariotpc# cat /etc/nginx/nginx.conf | |
user www; | |
worker_processes auto; #it will be determinate automatically by the number of core | |
error_log /var/log/nginx/error.log warn; | |
#pid /var/run/nginx/nginx.pid; # it permits the use of /etc/init.d/nginx reload|start|restart|stop | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
sendfile on; | |
access_log /var/log/nginx/access-log; | |
keepalive_timeout 3000; | |
server { | |
listen 80; | |
root /www; | |
index index.html index.htm; | |
server_name localhost; | |
client_max_body_size 32m; | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /var/lib/nginx/html; | |
} | |
} | |
} | |
#################### END CONF ################################## | |
vi /www/index.html | |
rc-service nginx start | |
rc-service nginx status | |
nginx -t | |
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok | |
nginx: configuration file /etc/nginx/nginx.conf test is successful | |
rc-service nginx reload | |
rc-service nginx restart | |
######### CHECK OPEN PORT ########################### | |
alpine:~$ netstat -tulpn | |
netstat: showing only processes with your user ID | |
Active Internet connections (only servers) | |
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name | |
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - | |
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - | |
tcp 0 0 :::22 :::* LISTEN - | |
alpine:~$ ifconfig | |
eth0 Link encap:Ethernet HWaddr 52:54:00:35:BC:7D | |
inet addr:192.168.122.27 Bcast:0.0.0.0 Mask:255.255.255.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment