sh 这个最小的设置允许你使用当前文件夹作为doc-root运行nginx.NOTE:python的simplehttpserver可能足够好f

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 这个最小的设置允许你使用当前文件夹作为doc-root运行nginx.NOTE:python的simplehttpserver可能足够好f相关的知识,希望对你有一定的参考价值。

www/
nginx.conf
1. Get all of these files into the target folder
2. Run the following commands:

```
chmod +x *.sh
./start.sh
```
worker_rlimit_nofile 8192;
daemon off;

events {
  worker_connections  4096;
}

http {
  server {
    listen       8080;
    server_name  localhost;

    include /etc/nginx/mime.types;

    default_type  application/octet-stream;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;

    access_log   nginx-access.log;
    error_log    nginx-error.log;

    location / {
      root    SOURCE_ROOT/www;
    }
  }
}
#!/bin/sh

sed "s|SOURCE_ROOT|$(pwd)|" nginx.conf.template > nginx.conf
nginx -c $(pwd)/nginx.conf
echo "**** Access running server at http://localhost:8080 ****"

以上是关于sh 这个最小的设置允许你使用当前文件夹作为doc-root运行nginx.NOTE:python的simplehttpserver可能足够好f的主要内容,如果未能解决你的问题,请参考以下文章