- Get all of these files into the target folder
- Run the following commands:
chmod +x *.sh
./nginx-start.sh
| #!/bin/sh | |
| sed "s|SOURCE_ROOT|$(pwd)|" nginx.conf.template > nginx.conf | |
| nginx -c $(pwd)/nginx.conf | |
| echo "**** Access running server at http://localhost:[PORT] ****" |
| nginx -s stop |
| daemon off; | |
| worker_rlimit_nofile 8192; | |
| events { | |
| worker_connections 4096; | |
| } | |
| http { | |
| server { | |
| listen 4000; | |
| server_name localhost; | |
| include /usr/local/etc/nginx/mime.types; | |
| default_type application/octet-stream; | |
| sendfile on; | |
| tcp_nopush on; | |
| tcp_nodelay on; | |
| access_log /dev/stdout; | |
| error_log /dev/stdout info; | |
| location / { | |
| root SOURCE_ROOT/_site; | |
| } | |
| } | |
| } |